aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-dialog-utils.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2002-08-27 03:33:49 +0800
committerPeter Williams <peterw@src.gnome.org>2002-08-27 03:33:49 +0800
commitc19d5d6d8bafd96921522cf90eb0cf0b06cd82c3 (patch)
tree31fa874acae3ad80dbb6c93585dfcf11e0f15ebc /e-util/e-dialog-utils.c
parent4fd7dd89f36a9dea7ea7f775cfc7f803effbfc3e (diff)
downloadgsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.tar.gz
gsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.tar.zst
gsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.zip
If gdk_window_foreign_new returned NULL, we're probably screwed, but try
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). svn path=/trunk/; revision=17866
Diffstat (limited to 'e-util/e-dialog-utils.c')
-rw-r--r--e-util/e-dialog-utils.c9
1 files changed, 9 insertions, 0 deletions
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);