X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50bcd1ae77ba4953d62c9141a78a36b5f4b57936..e8ac7bf221aec78b2a420660db711eed2e771670:/src/msw/taskbar.cpp?ds=inline diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index af35406da4..36d0de6c52 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -26,6 +26,7 @@ #include "wx/window.h" #include "wx/frame.h" #include "wx/utils.h" +#include "wx/menu.h" #endif #if defined(__WIN95__) && !defined(__TWIN32__) @@ -157,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; @@ -176,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; }