X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ae2df30524bb07bcca824bd0a842bd54a305ff3..48c12cb1290224f44161d9af774170d5f0fae440:/src/msw/taskbar.cpp diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 0fa9ef3a20..36d0de6c52 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -158,6 +158,16 @@ bool wxTaskBarIcon::RemoveIcon(void) bool wxTaskBarIcon::PopupMenu(wxMenu *menu) //, int x, int y); { + // OK, so I know this isn't thread-friendly, but + // what to do? We need this check. + + static bool s_inPopup = FALSE; + + if (s_inPopup) + return FALSE; + + s_inPopup = TRUE; + bool rval = FALSE; wxWindow* win; int x, y; @@ -177,7 +187,9 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) //, int x, int y); win->PopEventHandler(FALSE); win->Destroy(); - //delete win; + delete win; + + s_inPopup = FALSE; return rval; }