Check if widget is still valid in wxGTK size reset callback

The transient top-level window might have been already deleted by the time the
idle callback is executed, so check that the widget still exists before using
it.

This fixes multiple GTK+ errors on startup of an application showing any kind
of temporary windows (e.g. a splash screen) since the changes of the commit
bc4df78421.
This commit is contained in:
Vadim Zeitlin
2016-07-28 00:04:30 +02:00
parent cf033b47b1
commit 9dc7a89ccd

View File

@@ -1153,7 +1153,12 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
extern "C" {
static gboolean reset_size_request(void* data)
{
gtk_widget_set_size_request(GTK_WIDGET(data), -1, -1);
if ( GTK_IS_WIDGET(data) )
{
gtk_widget_set_size_request(GTK_WIDGET(data), -1, -1);
}
//else: the window has probably been deleted before the idle callback was
// invoked
return false;
}
}