signals: Ensure we ref handler in emission fast path
authorAlexander Larsson <alexl@redhat.com>
Thu, 21 Feb 2013 15:10:36 +0000 (16:10 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 21 Feb 2013 15:54:44 +0000 (16:54 +0100)
commitaede77464259e6d50e724113c16f301367201a72
treeef79b75635034b11a628c880a81c25f7ec962df2
parent3e274423bacfa1b702fea93fba9d6d44c650db44
signals: Ensure we ref handler in emission fast path

We need to keep a reference to the handler in the fast path, just like
in the slow path, otherwise if another thread disconnects the handler
we may destroy the closure while we're using it without the lock held.

We also move the freeing of the instance to after the emission is totally
done as the handler_unref_R (and the tracepoint) reference it.

https://bugzilla.gnome.org/show_bug.cgi?id=694253
gobject/gsignal.c