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:
parent
7e1db1aa4f
commit
0d481950f9
1 changed files with 14 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue