aboutsummaryrefslogtreecommitdiffstats
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
parent4fd7dd89f36a9dea7ea7f775cfc7f803effbfc3e (diff)
downloadgsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.tar
gsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.tar.gz
gsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.tar.bz2
gsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.tar.lz
gsoc2013-evolution-c19d5d6d8bafd96921522cf90eb0cf0b06cd82c3.tar.xz
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
-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);