Fix dialogs sample never exiting with a persistent taskbar icon

If the latest user notification shown was shown with
"Use persistent taskbar icon" toggled on, the application process
would never really exit after closing. So delete m_taskbarIcon
in destructor.

Closes #24316.
This commit is contained in:
Lauri Nurmi 2024-02-13 12:52:43 +02:00 committed by Vadim Zeitlin
parent f27c199fa8
commit 1864a49dd2

View file

@ -2552,6 +2552,15 @@ public:
Bind(wxEVT_BUTTON, &TestNotificationMessageWindow::OnCloseClicked, this, wxID_CLOSE);
}
~TestNotificationMessageWindow()
{
#if defined(__WXMSW__) && wxUSE_TASKBARICON
// If the persistent taskbar icon has been created and is
// not deleted at the end, the application will never exit.
delete m_taskbarIcon;
#endif
}
private:
enum
{