]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix crash when creating and quickly destroying a wxTLW in wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 15 Jun 2011 13:33:02 +0000 (13:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 15 Jun 2011 13:33:02 +0000 (13:33 +0000)
Don't crash in timer callback added to work around broken Ubuntu 11.04 WM,
remove it when the window is being destroyed.

This corrects a crash which happened if a TLW was created and destroyed before
this timer had time to fire under Ubuntu.

Closes #13146.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/toplevel.cpp

index 03bf36695f7c3ed30cfe812914d868ebae24d344..506233552535b0542c4be902c677e8111bd06545 100644 (file)
@@ -713,6 +713,13 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
 
 wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
 {
+    if ( m_netFrameExtentsTimerId )
+    {
+        // Don't let the timer callback fire as the window pointer passed to it
+        // will become invalid very soon.
+        g_source_remove(m_netFrameExtentsTimerId);
+    }
+
 #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
     // it can also be a (standard) dialog
     if ( HILDON_IS_WINDOW(m_widget) )