Browse Source

Windows: Fix potential accessibility related leaks

v7.0.9
attila Attila Szarvas 2 years ago
parent
commit
f16a430f08
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      modules/juce_gui_basics/native/accessibility/juce_UIAGridItemProvider_windows.h
  2. +2
    -2
      modules/juce_gui_basics/native/accessibility/juce_UIAGridProvider_windows.h

+ 2
- 2
modules/juce_gui_basics/native/accessibility/juce_UIAGridItemProvider_windows.h View File

@@ -93,12 +93,12 @@ public:
if (isPositiveAndBelow (column->begin, children.size()))
{
IRawElementProviderSimple* provider = nullptr;
ComSmartPtr<IRawElementProviderSimple> provider;
if (auto* child = children[(size_t) column->begin])
{
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wlanguage-extension-token")
if (child->getNativeImplementation()->QueryInterface (IID_PPV_ARGS (&provider)) == S_OK && provider != nullptr)
if (child->getNativeImplementation()->QueryInterface (IID_PPV_ARGS (provider.resetAndGetPointerAddress())) == S_OK && provider != nullptr)
{
*pRetVal = SafeArrayCreateVector (VT_UNKNOWN, 0, 1);
LONG index = 0;


+ 2
- 2
modules/juce_gui_basics/native/accessibility/juce_UIAGridProvider_windows.h View File

@@ -99,11 +99,11 @@ public:
for (const auto& child : children)
{
IRawElementProviderSimple* provider = nullptr;
ComSmartPtr<IRawElementProviderSimple> provider;
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wlanguage-extension-token")
if (child != nullptr)
child->getNativeImplementation()->QueryInterface (IID_PPV_ARGS (&provider));
child->getNativeImplementation()->QueryInterface (IID_PPV_ARGS (provider.resetAndGetPointerAddress()));
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
if (provider == nullptr)


Loading…
Cancel
Save