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:
@@ -1153,7 +1153,12 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
static gboolean reset_size_request(void* data)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user