diff --git a/WDL/swell/swell-wnd-generic.cpp b/WDL/swell/swell-wnd-generic.cpp index 2c29c2c..0fc59ae 100644 --- a/WDL/swell/swell-wnd-generic.cpp +++ b/WDL/swell/swell-wnd-generic.cpp @@ -7173,6 +7173,7 @@ static void runMenuBar(HWND hwnd, HMENU__ *menu, int x, const RECT *use_r) mbr.top = -g_swell_ctheme.menubar_height; menu->sel_vis = x; g_menubar_active = hwnd; + hwnd->Retain(); for (;;) { InvalidateRect(hwnd,&mbr,FALSE); @@ -7188,6 +7189,7 @@ static void runMenuBar(HWND hwnd, HMENU__ *menu, int x, const RECT *use_r) InvalidateRect(hwnd,&mbr,FALSE); g_menubar_active = NULL; g_trackpopup_yroot.top = g_trackpopup_yroot.bottom = 0; + hwnd->Release(); } LRESULT DefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)