From bebe622dff67c0af79d602ca34094c25ad1873f9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Dec 2007 16:47:34 +0000 Subject: [PATCH] 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 --- src/msw/taskbar.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- 2.50.0