diff options
author | Tim Janik <timj@gimp.org> | 1998-02-10 06:53:08 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-02-10 06:53:08 +0000 |
commit | 6898536a026027839cf1f6662f30f793dbe4e8d3 (patch) | |
tree | 0ab69467c31ba342957802e0e94aa7698f2e59b1 /gtk/gtkmain.c | |
parent | f98686da856ea0c0dfb6050f233c0cb02ee8c861 (diff) | |
download | gtk+-6898536a026027839cf1f6662f30f793dbe4e8d3.tar.gz |
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
Diffstat (limited to 'gtk/gtkmain.c')
-rw-r--r-- | gtk/gtkmain.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index c069f62cdb..e442172454 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -100,7 +100,7 @@ static void gtk_message (gchar *str); static void gtk_print (gchar *str); -static gint done; +static gboolean iteration_done = FALSE; static guint main_level = 0; static gint initialized = FALSE; static GdkEvent *next_event = NULL; @@ -214,10 +214,10 @@ gtk_main () g_list_free (functions); - old_done = done; + old_done = iteration_done; while (!gtk_main_iteration ()) ; - done = old_done; + iteration_done = old_done; main_level--; } @@ -231,7 +231,7 @@ gtk_main_level (void) void gtk_main_quit () { - done = TRUE; + iteration_done = TRUE; } gint @@ -254,7 +254,7 @@ gtk_main_iteration_do (gboolean blocking) GdkEvent *event = NULL; GList *tmp_list; - done = FALSE; + iteration_done = FALSE; /* If this is a recursive call, and there are pending timeouts or * idles, finish them, then return immediately to avoid blocking @@ -263,12 +263,12 @@ gtk_main_iteration_do (gboolean blocking) if (current_timeouts) { gtk_handle_current_timeouts( gdk_time_get()); - return done; + return iteration_done; } if (current_idles) { gtk_handle_current_idles(); - return done; + return iteration_done; } /* If there is a valid event in 'next_event' then move it to 'event' @@ -479,7 +479,7 @@ event_handling_done: */ gtk_handle_timeouts (); - return done; + return iteration_done; } gint |