glib/gobject
Ryan Lortie d89fb7bf10 gsignal: fix closure invalidation code
This is the bug that has been causing segfaults and criticals when accel
keys are used to close windows via GtkUIManager.

The main cause of this problem was a mistake made in the original patch
when modifying the handler_lookup() to take the extra 'closure'
parameter.  The original check used was:

    if (handler->sequential_number == handler_id ||
       (closure && handler->closure == closure))

It was called to find a particular closure like so:

    handler_lookup (instance, 0, closure, &signal_id);

The problem is that the check will return if either the signal ID or
closure matches (if a closure was given).  The calling code assumes 0 to
be an invalid signal ID which will match no handlers, but unfortunately
the rest of gsignal code uses this to denote a signal that has already
been disconnected.  The result is that this function was searching for a
matching closure _or_ the first already-disconnected handler.  When it
found the already-disconnected handler, we'd get criticals and crashes.

The condition has been corrected; it now ignores the handler_id
parameter if the closure parameter is non-NULL.

While we're in here, change the lifecycle of the invalidation notify to
be easier to understand.

Before, the notify was removed when the last reference on the handler
dropped.  This could happen in very many situations; often at the end of
an emission.  Instead, we now tie the registration of the notifier to
the lifecycle of the signal connection.  When the signal is disconnected
we remove the notification, even if other references are held (eg:
because it is currently being dispatched).

https://bugzilla.gnome.org/show_bug.cgi?id=690118
2013-01-16 23:04:11 -05:00
..
tests gtype: disallow adding interfaces after the fact 2013-01-04 21:20:04 +01:00
.gitignore Stop using glib-genmarshal at build time 2011-06-20 17:24:07 -04:00
abicheck.sh Simply symbols files 2011-05-23 00:21:06 -04:00
ChangeLog Update README files to refer to git 2009-03-31 19:39:16 -04:00
gatomicarray.c Improvde #include order consistency 2013-01-01 13:54:54 -05:00
gatomicarray.h Move single-include guards inside include guards 2012-12-27 23:43:14 -05:00
gbinding.c Fix binding properties of the same object 2012-03-04 20:49:04 -05:00
gbinding.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gboxed.c gmarkup: Make GMarkupParseContext a boxed type 2013-01-01 11:03:19 -05:00
gboxed.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gclosure.c Improvde #include order consistency 2013-01-01 13:54:54 -05:00
gclosure.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
genums.c documentation fixes 2011-12-13 23:01:51 -05:00
genums.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
glib-genmarshal.c Revert "Improvde #include order consistency" 2013-01-15 19:35:52 +08:00
glib-mkenums.in glib-mkenums: fix handling of forward enum declarations 2012-02-07 13:32:22 -05:00
glib-types.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gmarshal.c Use G_VA_COPY instead of va_copy() 2012-03-08 14:51:22 +08:00
gmarshal.h gmarshal.h: replace "extern" with GLIB_AVAILABLE_IN_ALL 2013-01-13 13:13:55 -05:00
gmarshal.list Update the comment in gmarshal.list 2012-06-23 17:53:22 -04:00
gobject_probes.d Add missing semicolons to gobject_probes.d 2012-10-15 19:48:44 -04:00
gobject_trace.h Add dtrace and systemtap support for gobject 2010-05-27 14:51:41 -04:00
gobject-query.c Remove g_type_init() calls 2012-10-16 09:39:24 -04:00
gobject.c GObject: Fix code snippet in description of floating reference. 2012-11-21 18:09:46 -05:00
gobject.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gobject.py Initial support for gdb python macros 2009-09-21 15:39:00 +02:00
gobject.rc.in Update the year in the *.rc.in files 2011-06-07 08:55:31 +08:00
gobject.stp.in Add dtrace and systemtap support for gobject 2010-05-27 14:51:41 -04:00
gobject.symbols gmarkup: Make GMarkupParseContext a boxed type 2013-01-01 11:03:19 -05:00
gobjectnotifyqueue.c [notify] add warning to gobjectnotifyqueue.c 2011-11-16 17:50:13 +00:00
gparam.c It is 'registered', not 'registred' 2012-08-18 23:17:47 -04:00
gparam.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gparamspecs.c GParamSpec: Make constructors introspectable 2013-01-14 11:36:14 +01:00
gparamspecs.h Add a new _GLIB_EXTERN macro for "extern" 2013-01-13 13:13:36 -05:00
gsignal.c gsignal: fix closure invalidation code 2013-01-16 23:04:11 -05:00
gsignal.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gsourceclosure.c gobject: Use G_VALUE_INIT 2011-10-18 17:12:33 +01:00
gsourceclosure.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gtype-private.h Move single-include guards inside include guards 2012-12-27 23:43:14 -05:00
gtype.c gtype: disallow adding interfaces after the fact 2013-01-04 21:20:04 +01:00
gtype.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gtypemodule.c Do not use static GTypeInfo and GInterfaceInfo 2011-11-29 22:03:25 -05:00
gtypemodule.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gtypeplugin.c Do not use static GTypeInfo and GInterfaceInfo 2011-11-29 22:03:25 -05:00
gtypeplugin.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gvalue.c Remove g_type_init() calls 2012-10-16 09:39:24 -04:00
gvalue.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
gvaluearray.c Add G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS 2012-02-15 09:54:38 -05:00
gvaluearray.h GValueArray: clarify the deprecation warnings 2013-01-02 13:02:51 -05:00
gvaluecollector.h Constify collect and lcopy strings in GTypeValueTable 2012-07-05 23:27:35 -04:00
gvaluetransform.c valuetransform: Fix definition of ulong_bool 2012-06-27 10:59:29 +02:00
gvaluetypes.c values: Use v_pointer for g_value_set_gtype() 2012-01-14 01:15:16 +01:00
gvaluetypes.h various: add GLIB_AVAILABLE_IN_ALL everywhere else 2013-01-13 13:11:57 -05:00
libgobject-gdb.py.in Avoid shadowing the dir builtin 2010-12-03 14:08:36 -05:00
Makefile.am visibility: Use a separate CFLAGS variable 2013-01-14 23:31:59 -05:00
makefile.msc.in gobject/: fully remove gobjectalias hacks 2010-07-07 19:40:48 -04:00
marshal-genstrings.pl Hacky script to fix up your .msc.in files on windows. Dunno if this is a 2001-08-04 15:49:55 +00:00