new function to check whether a handler is still connected to an instance

Mon May 14 01:49:01 2001  Tim Janik  <timj@gtk.org>

        * gsignal.[hc] (g_signal_handler_is_connected): new function
        to check whether a handler is still connected to an instance
        (by handler id).
This commit is contained in:
Tim Janik 2001-05-14 13:55:51 +00:00 committed by Tim Janik
parent d5033d53bd
commit 72df5e6cab
3 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,9 @@
Mon May 14 01:49:01 2001 Tim Janik <timj@gtk.org>
* gsignal.[hc] (g_signal_handler_is_connected): new function
to check whether a handler is still connected to an instance
(by handler id).
Thu May 10 14:00:48 2001 Tim Janik <timj@gtk.org>
* gparamspecs.[hc]: removed g_param_spec_stringc() in lack of

View File

@ -1416,6 +1416,24 @@ g_signal_handler_disconnect (gpointer instance,
G_UNLOCK (g_signal_mutex);
}
gboolean
g_signal_handler_is_connected (gpointer instance,
gulong handler_id)
{
Handler *handler;
gboolean connected;
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (instance), FALSE);
g_return_val_if_fail (handler_id > 0, FALSE);
G_LOCK (g_signal_mutex);
handler = handler_lookup (instance, handler_id, NULL);
connected = handler != NULL;
G_UNLOCK (g_signal_mutex);
return connected;
}
void
g_signal_handlers_destroy (gpointer instance)
{

View File

@ -185,6 +185,8 @@ void g_signal_handler_unblock (gpointer instance,
gulong handler_id);
void g_signal_handler_disconnect (gpointer instance,
gulong handler_id);
gboolean g_signal_handler_is_connected (gpointer instance,
gulong handler_id);
gulong g_signal_handler_find (gpointer instance,
GSignalMatchType mask,
guint signal_id,