mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
gmain: Ensure old reference is valid during unref
We were checking this already, leading to an extra atomic read that isn't needed.
This commit is contained in:
parent
5d117b021a
commit
7097359597
@ -2229,6 +2229,8 @@ retry_beginning:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_return_if_fail (old_ref > 0);
|
||||||
|
|
||||||
if (!have_lock && context)
|
if (!have_lock && context)
|
||||||
LOCK_CONTEXT (context);
|
LOCK_CONTEXT (context);
|
||||||
|
|
||||||
@ -2359,7 +2361,7 @@ void
|
|||||||
g_source_unref (GSource *source)
|
g_source_unref (GSource *source)
|
||||||
{
|
{
|
||||||
g_return_if_fail (source != NULL);
|
g_return_if_fail (source != NULL);
|
||||||
g_return_if_fail (g_atomic_int_get (&source->ref_count) > 0);
|
/* refcount is checked inside g_source_unref_internal() */
|
||||||
|
|
||||||
g_source_unref_internal (source, source->context, FALSE);
|
g_source_unref_internal (source, source->context, FALSE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user