X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f26623c81769a5ec293dcad0ee6ed3fa48b07f82..2e2a55b22eebde25797bd030660d8c644bc7700b:/src/gtk1/window.cpp?ds=sidebyside diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index c6f04210f9..03c6f88e39 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -7,11 +7,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "window.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -2883,11 +2878,22 @@ wxWindowGTK::~wxWindowGTK() m_isBeingDeleted = true; m_hasVMT = false; + // destroy children before destroying this window itself + DestroyChildren(); + + // unhook focus handlers to prevent stray events being + // propagated to this (soon to be) dead object + if (m_focusWidget != NULL) + { + gtk_signal_disconnect_by_func( GTK_OBJECT(m_focusWidget), + (GtkSignalFunc) gtk_window_focus_in_callback, (gpointer) this ); + gtk_signal_disconnect_by_func( GTK_OBJECT(m_focusWidget), + (GtkSignalFunc) gtk_window_focus_out_callback, (gpointer) this ); + } + if (m_widget) Show( false ); - DestroyChildren(); - #ifdef HAVE_XIM if (m_ic) gdk_ic_destroy (m_ic); @@ -2895,6 +2901,11 @@ wxWindowGTK::~wxWindowGTK() gdk_ic_attr_destroy (m_icattr); #endif +#ifdef __WXGTK20__ + // delete before the widgets to avoid a crash on solaris + delete m_imData; +#endif + if (m_wxwindow) { gtk_widget_destroy( m_wxwindow ); @@ -2906,10 +2917,6 @@ wxWindowGTK::~wxWindowGTK() gtk_widget_destroy( m_widget ); m_widget = (GtkWidget*) NULL; } - -#ifdef __WXGTK20__ - delete m_imData; -#endif } bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size )