cancellable: Connect to cancelled signal using the ID

Avoid fetching the signal-ID by its name since we know it here
This commit is contained in:
Marco Trevisan (Treviño) 2025-04-02 19:40:41 +02:00
parent eedf75e810
commit 7086823bb2

View File

@ -583,10 +583,12 @@ g_cancellable_connect (GCancellable *cancellable,
}
else
{
id = g_signal_connect_data (cancellable, "cancelled",
callback, data,
(GClosureNotify) data_destroy_func,
G_CONNECT_DEFAULT);
GClosure *closure;
closure = g_cclosure_new (callback, data,
(GClosureNotify) data_destroy_func);
id = g_signal_connect_closure_by_id (cancellable, signals[CANCELLED],
0, closure, FALSE);
}
g_mutex_unlock (&cancellable->priv->mutex);