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/gtksignal.h | |
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/gtksignal.h')
-rw-r--r-- | gtk/gtksignal.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gtk/gtksignal.h b/gtk/gtksignal.h index d03d7d570b..e6c66f031e 100644 --- a/gtk/gtksignal.h +++ b/gtk/gtksignal.h @@ -60,16 +60,17 @@ struct _GtkSignalQuery struct _GtkHandler { - guint16 id; - guint16 ref_count; - guint16 signal_type; - guint object_signal : 1; + guint id : 28; guint blocked : 1; + guint object_signal : 1; guint after : 1; guint no_marshal : 1; + guint16 ref_count; + guint16 signal_type; GtkSignalFunc func; gpointer func_data; GtkSignalDestroy destroy_func; + GtkHandler *prev; GtkHandler *next; }; |