From 9dc7a89ccdf20672f890cb2a576c319fb7db57b5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 28 Jul 2016 00:04:30 +0200 Subject: [PATCH] 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 bc4df78421a5b1e6fd9b218e89d03e59bd846d0a. --- src/gtk/toplevel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 1b5dcbf789..f20f59c82d 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -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; } }