mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
gcancellable: don't use g_cancellable_connect() in GCancellableSource
g_cancellable_connect() is documented as calling its callback only once, but GCancellableSource should trigger every time the cancellable is cancelled. https://bugzilla.gnome.org/show_bug.cgi?id=710691 https://bugzilla.gnome.org/show_bug.cgi?id=711286
This commit is contained in:
parent
b4aee2a759
commit
fff14a5b7c
@ -736,11 +736,16 @@ g_cancellable_source_new (GCancellable *cancellable)
|
||||
if (cancellable)
|
||||
{
|
||||
cancellable_source->cancellable = g_object_ref (cancellable);
|
||||
|
||||
/* We intentionally don't use g_cancellable_connect() here,
|
||||
* because we don't want the "at most once" behavior.
|
||||
*/
|
||||
cancellable_source->cancelled_handler =
|
||||
g_cancellable_connect (cancellable,
|
||||
G_CALLBACK (cancellable_source_cancelled),
|
||||
source,
|
||||
NULL);
|
||||
g_signal_connect (cancellable, "cancelled",
|
||||
G_CALLBACK (cancellable_source_cancelled),
|
||||
source);
|
||||
if (g_cancellable_is_cancelled (cancellable))
|
||||
g_source_set_ready_time (source, 0);
|
||||
}
|
||||
|
||||
return source;
|
||||
|
Loading…
Reference in New Issue
Block a user