mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 06:33:41 +02:00
docs: Document that signal connection functions cannot fail
The documentation previously implied that they could. That’s not really true though: they can only fail if preconditions fail, i.e. they’re passed invalid input. That’s a programmer error, which is not something we want to encourage people to check for at runtime (e.g. by dynamically checking for a 0 return value). Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
@@ -2301,7 +2301,10 @@ g_signal_get_invocation_hint (gpointer instance)
|
||||
* If @closure is a floating reference (see g_closure_sink()), this function
|
||||
* takes ownership of @closure.
|
||||
*
|
||||
* Returns: the handler ID (always greater than 0 for successful connections)
|
||||
* This function cannot fail. If the given signal doesn’t exist, a critical
|
||||
* warning is emitted.
|
||||
*
|
||||
* Returns: the handler ID (always greater than 0)
|
||||
*/
|
||||
gulong
|
||||
g_signal_connect_closure_by_id (gpointer instance,
|
||||
@@ -2366,7 +2369,10 @@ g_signal_connect_closure_by_id (gpointer instance,
|
||||
* If @closure is a floating reference (see g_closure_sink()), this function
|
||||
* takes ownership of @closure.
|
||||
*
|
||||
* Returns: the handler ID (always greater than 0 for successful connections)
|
||||
* This function cannot fail. If the given signal doesn’t exist, a critical
|
||||
* warning is emitted.
|
||||
*
|
||||
* Returns: the handler ID (always greater than 0)
|
||||
*/
|
||||
gulong
|
||||
g_signal_connect_closure (gpointer instance,
|
||||
@@ -2462,7 +2468,10 @@ node_check_deprecated (const SignalNode *node)
|
||||
* used. Specify @connect_flags if you need `..._after()` or
|
||||
* `..._swapped()` variants of this function.
|
||||
*
|
||||
* Returns: the handler ID (always greater than 0 for successful connections)
|
||||
* This function cannot fail. If the given signal doesn’t exist, a critical
|
||||
* warning is emitted.
|
||||
*
|
||||
* Returns: the handler ID (always greater than 0)
|
||||
*/
|
||||
gulong
|
||||
g_signal_connect_data (gpointer instance,
|
||||
|
Reference in New Issue
Block a user