diff --git a/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp b/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp index 29593758a7..7f1743329e 100644 --- a/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp @@ -251,6 +251,11 @@ public: ~Pimpl() override { + // If the wndproc of the ActiveX HWND isn't set back to it's original + // wndproc, then clientSite will leak when control is released + if (controlHWND != nullptr) + SetWindowLongPtr ((HWND) controlHWND, GWLP_WNDPROC, (LONG_PTR) originalWndProc); + if (control != nullptr) { control->Close (OLECLOSE_NOSAVE); diff --git a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp index 04083be639..9d3f7a6e59 100644 --- a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp @@ -60,7 +60,10 @@ public: ~Win32WebView() override { if (connectionPoint != nullptr) + { connectionPoint->Unadvise (adviseCookie); + connectionPoint->Release(); + } if (browser != nullptr) browser->Release(); @@ -91,6 +94,8 @@ public: handler->Release(); } } + + connectionPointContainer->Release(); } JUCE_END_IGNORE_WARNINGS_GCC_LIKE