aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-dialog-utils.c9
2 files changed, 15 insertions, 0 deletions
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 <peterw@ximian.com>
+
+ * 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 <rodrigo@ximian.com>
* 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);