-
Simon McVittie authored
Commit 281e3010 narrowed the race between GCancellable::cancelled and GCancellableSource's finalize(), but did not prevent it: there was nothing to stop cancellation from occurring after the refcount drops to 0, but before g_source_unref_internal() bumps it back up to 1 to run finalize(). GCancellable cannot be expected to detect that situation, because the only way it has to detect last-unref is finalize(), but in that situation finalize() hasn't happened yet. Instead of detecting last-unref, relax the precondition a little to make it detect finalization: priv is only poisoned (set to NULL) after the finalize() function has been called, so we can assume that GCancellable has already seen finalize() by then. Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=791754 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884654
7f3bfcb8