Fix crash when creating and quickly destroying a wxTLW in wxGTK.

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
This commit is contained in:
Vadim Zeitlin 2011-06-15 13:33:02 +00:00
parent 8c636fd789
commit c0866512a7

View 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) )