summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>1998-01-02 03:43:24 +0000
committerElliot Lee <sopwith@src.gnome.org>1998-01-02 03:43:24 +0000
commitaf9e316ce68828fdc77110b06e77502126bec759 (patch)
treefda450d650f75bab69413b259c00be4a57133337
parent92610dafdba512ba4db6d2dedbc369e24b69f739 (diff)
downloadgtk+-af9e316ce68828fdc77110b06e77502126bec759.tar.gz
Fixed recursing bug in gdk_exit_func()
-rw-r--r--gdk/gdk.c8
-rw-r--r--gdk/x11/gdkmain-x11.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/gdk/gdk.c b/gdk/gdk.c
index d9413e9aeb..7820373249 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -2844,6 +2844,14 @@ gdk_synthesize_click (GdkEvent *event,
static void
gdk_exit_func ()
{
+ static gboolean in_gdk_exit_func = FALSE;
+
+ /* This is to avoid an infinite loop if a program segfaults in
+ an atexit() handler (and yes, it does happen, especially if a program
+ has trounced over memory too badly for even g_print to work) */
+ if(in_gdk_exit_func == TRUE) return;
+ in_gdk_exit_func = TRUE;
+
if (initialized)
{
#ifdef USE_XIM
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index d9413e9aeb..7820373249 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -2844,6 +2844,14 @@ gdk_synthesize_click (GdkEvent *event,
static void
gdk_exit_func ()
{
+ static gboolean in_gdk_exit_func = FALSE;
+
+ /* This is to avoid an infinite loop if a program segfaults in
+ an atexit() handler (and yes, it does happen, especially if a program
+ has trounced over memory too badly for even g_print to work) */
+ if(in_gdk_exit_func == TRUE) return;
+ in_gdk_exit_func = TRUE;
+
if (initialized)
{
#ifdef USE_XIM