From c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 26 Aug 2002 19:33:49 +0000 Subject: If gdk_window_foreign_new returned NULL, we're probably screwed, but try 2002-08-26 Peter Williams * e-dialog-utils.c (set_transient_for_gdk): If gdk_window_foreign_new returned NULL, we're probably screwed, but try to avoid a segfault. (Preemptive fix suggested by kmaraas). svn path=/trunk/; revision=17866 --- e-util/ChangeLog | 6 ++++++ e-util/e-dialog-utils.c | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 9b2788118a..3d6dd456f8 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2002-08-26 Peter Williams + + * e-dialog-utils.c (set_transient_for_gdk): If gdk_window_foreign_new + returned NULL, we're probably screwed, but try to avoid a segfault. + (Preemptive fix suggested by kmaraas). + 2002-08-26 Rodrigo Moya * e-config-listener.c (e_config_listener_get_string_with_default): diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c index 4561488abd..4e77cce646 100644 --- a/e-util/e-dialog-utils.c +++ b/e-util/e-dialog-utils.c @@ -86,6 +86,15 @@ set_transient_for_gdk (GtkWindow *window, g_return_if_fail (window != NULL); g_return_if_fail (gtk_object_get_data (GTK_OBJECT (window), TRANSIENT_DATA_ID) == NULL); + /* if the parent window doesn't exist anymore, + * something is probably about to go very wrong, + * but at least let's not segfault here. */ + + if (parent == NULL) { + g_warning ("set_transient_for_gdk: uhoh, parent of window %p is NULL", window); + return; + } + gdk_window_ref (parent); /* FIXME? */ gtk_object_set_data (GTK_OBJECT (window), TRANSIENT_DATA_ID, parent); -- cgit v1.2.3