projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
adding constant which appears in Leopard SDK only
[wxWidgets.git]
/
src
/
unix
/
taskbarx11.cpp
diff --git
a/src/unix/taskbarx11.cpp
b/src/unix/taskbarx11.cpp
index 06118f3109a40061e0ecac2c0fa58eed18fe5232..ced3b5e059716e7060ce6ae4f6e17d0d384f2a75 100644
(file)
--- a/
src/unix/taskbarx11.cpp
+++ b/
src/unix/taskbarx11.cpp
@@
-263,7
+263,11
@@
wxTaskBarIcon::wxTaskBarIcon() : m_iconWnd(NULL)
wxTaskBarIcon::~wxTaskBarIcon()
{
if (m_iconWnd)
wxTaskBarIcon::~wxTaskBarIcon()
{
if (m_iconWnd)
+ {
+ m_iconWnd->Disconnect(
+ wxEVT_DESTROY, wxObjectEventFunction(NULL), NULL, this);
RemoveIcon();
RemoveIcon();
+ }
}
bool wxTaskBarIcon::IsOk() const
}
bool wxTaskBarIcon::IsOk() const
@@
-276,6
+280,14
@@
bool wxTaskBarIcon::IsIconInstalled() const
return m_iconWnd != NULL;
}
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;
bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
{
wxBitmap bmp;
@@
-286,6
+298,9
@@
bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
m_iconWnd = new wxTaskBarIconArea(this, bmp);
if (m_iconWnd->IsOk())
{
m_iconWnd = new wxTaskBarIconArea(this, bmp);
if (m_iconWnd->IsOk())
{
+ m_iconWnd->Connect(wxEVT_DESTROY,
+ wxWindowDestroyEventHandler(wxTaskBarIcon::OnDestroy),
+ NULL, this);
m_iconWnd->Show();
}
else
m_iconWnd->Show();
}
else