diff options
author | Elliot Lee <sopwith@src.gnome.org> | 1998-01-02 03:43:24 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1998-01-02 03:43:24 +0000 |
commit | af9e316ce68828fdc77110b06e77502126bec759 (patch) | |
tree | fda450d650f75bab69413b259c00be4a57133337 | |
parent | 92610dafdba512ba4db6d2dedbc369e24b69f739 (diff) | |
download | gtk+-af9e316ce68828fdc77110b06e77502126bec759.tar.gz |
Fixed recursing bug in gdk_exit_func()
-rw-r--r-- | gdk/gdk.c | 8 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 8 |
2 files changed, 16 insertions, 0 deletions
@@ -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 |