return m_iconWnd != NULL;
}
+// Destroy event from wxTaskBarIconArea
+void wxTaskBarIcon::OnDestroy(wxWindowDestroyEvent&)
+{
+ // prevent crash if wxTaskBarIconArea is destroyed by something else,
+ // for example if panel/kicker is killed
+ m_iconWnd = NULL;
+}
+
bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
{
wxBitmap bmp;
m_iconWnd = new wxTaskBarIconArea(this, bmp);
if (m_iconWnd->IsOk())
{
+ m_iconWnd->Connect(wxEVT_DESTROY,
+ wxWindowDestroyEventHandler(wxTaskBarIcon::OnDestroy),
+ NULL, this);
m_iconWnd->Show();
}
else