From: Vadim Zeitlin Date: Sun, 2 Dec 2007 16:47:34 +0000 (+0000) Subject: delete the TLW used by taskbar icons instead of destroying it to avoid hang on exit... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bebe622dff67c0af79d602ca34094c25ad1873f9 delete the TLW used by taskbar icons instead of destroying it to avoid hang on exit if there are no other windows left in the program git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index b03a1bebd1..83aef42cde 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -148,11 +148,17 @@ wxTaskBarIcon::wxTaskBarIcon() wxTaskBarIcon::~wxTaskBarIcon() { - if (m_iconAdded) + if ( m_iconAdded ) RemoveIcon(); - if (m_win) - m_win->Destroy(); + if ( m_win ) + { + // we must use delete and not Destroy() here because the latter will + // only schedule the window to be deleted during the next idle event + // processing but we may not get any idle events if there are no other + // windows left in the program + delete m_win; + } } // Operations