X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/837e57436a89516a5fa9f478f401e06bd872c17c..a8cb1d29e7fe349142d8d6be9fc9afe986340611:/src/msw/taskbar.cpp diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index fdf563dc37..e9ba5a03c6 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -37,9 +37,11 @@ #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include #endif #endif +#endif #ifdef __SALFORDC__ #include @@ -164,10 +166,16 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) //, int x, int y); win = new wxFrame(NULL, -1, "", wxPoint(x,y), wxSize(-1,-1), 0); win->PushEventHandler(this); + // Remove from record of top-level windows, or will confuse wxWindows + // if we try to exit right now. + wxTopLevelWindows.DeleteObject(win); + rval = win->PopupMenu(menu, 0, 0); win->PopEventHandler(FALSE); win->Destroy(); + delete win; + return rval; }