mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-21 09:42:10 +01:00
Merge branch 'mcatanzaro/mr4206-followup' into 'main'
gcancellable: remove sketchy source ref/unref See merge request GNOME/glib!4477
This commit is contained in:
commit
0b08232416
@ -742,15 +742,12 @@ cancellable_source_dispose (GSource *source)
|
||||
* dangling GCancellableSource pointer.
|
||||
*
|
||||
* Eliminate that race by waiting to ensure that our cancelled
|
||||
* callback has been called, keeping a temporary ref, so that
|
||||
* there's no risk that we're unreffing something that is still
|
||||
* going to be used.
|
||||
* callback has been called, so that there's no risk that we're
|
||||
* unreffing something that is still going to be used.
|
||||
*/
|
||||
|
||||
g_source_ref (source);
|
||||
while (!g_atomic_int_get (&cancellable_source->cancelled_callback_called))
|
||||
;
|
||||
g_source_unref (source);
|
||||
}
|
||||
|
||||
g_clear_signal_handler (&cancellable_source->cancelled_handler, cancellable);
|
||||
|
Loading…
x
Reference in New Issue
Block a user