1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-03 03:30:06 +00:00

Windows: Fix a leak due to the IDropTarget interface ref count not being decremented for child HWNDs after the parent HWND is destroyed

This commit is contained in:
ed 2018-09-13 10:18:00 +01:00
parent 7e1db1aa4f
commit 0d481950f9

View file

@ -2132,10 +2132,22 @@ private:
}
}
static BOOL CALLBACK revokeChildDragDropCallback (HWND hwnd, LPARAM) { RevokeDragDrop (hwnd); return TRUE; }
static void* destroyWindowCallback (void* handle)
{
RevokeDragDrop ((HWND) handle);
DestroyWindow ((HWND) handle);
auto hwnd = reinterpret_cast<HWND> (handle);
if (IsWindow (hwnd))
{
RevokeDragDrop (hwnd);
// NB: we need to do this before DestroyWindow() as child HWNDs will be invalid after
EnumChildWindows (hwnd, revokeChildDragDropCallback, 0);
DestroyWindow (hwnd);
}
return nullptr;
}