mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-16 12:28:48 +02: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)
|
if (cancellable)
|
||||||
{
|
{
|
||||||
cancellable_source->cancellable = g_object_ref (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 =
|
cancellable_source->cancelled_handler =
|
||||||
g_cancellable_connect (cancellable,
|
g_signal_connect (cancellable, "cancelled",
|
||||||
G_CALLBACK (cancellable_source_cancelled),
|
G_CALLBACK (cancellable_source_cancelled),
|
||||||
source,
|
source);
|
||||||
NULL);
|
if (g_cancellable_is_cancelled (cancellable))
|
||||||
|
g_source_set_ready_time (source, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return source;
|
return source;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user