Add G_SIGNAL_MUST_COLLECT

In some cases, signal arguments have to be collected, even if there are i
no signal handlers connected (e.g. for GVariant parameters, where collection
consumes a floating variant).

Based on a patch by Christian Persch.

Bug #643624.
This commit is contained in:
Christian Persch
2011-03-02 15:48:40 +01:00
committed by Ryan Lortie
parent c95ff4de04
commit 61b0e1c8d4
4 changed files with 104 additions and 5 deletions

View File

@@ -108,6 +108,8 @@ typedef gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint,
* of as object methods which can be called generically by
* third-party code.
* @G_SIGNAL_NO_HOOKS: No emissions hooks are supported for this signal.
* @G_SIGNAL_MUST_COLLECT: Varargs signal emission will always collect the
* arguments, even if there are no signal handlers connected. Since 2.30.
*
* The signal flags are used to specify a signal's behaviour, the overall
* signal description outlines how especially the RUN flags control the
@@ -121,14 +123,15 @@ typedef enum
G_SIGNAL_NO_RECURSE = 1 << 3,
G_SIGNAL_DETAILED = 1 << 4,
G_SIGNAL_ACTION = 1 << 5,
G_SIGNAL_NO_HOOKS = 1 << 6
G_SIGNAL_NO_HOOKS = 1 << 6,
G_SIGNAL_MUST_COLLECT = 1 << 7
} GSignalFlags;
/**
* G_SIGNAL_FLAGS_MASK:
*
* A mask for all #GSignalFlags bits.
*/
#define G_SIGNAL_FLAGS_MASK 0x7f
#define G_SIGNAL_FLAGS_MASK 0xff
/**
* GConnectFlags:
* @G_CONNECT_AFTER: whether the handler should be called before or after the