mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gobject: Add an assertion to avoid a static analysis false positive
Avoid scan-build thinking that `new_wrdata` could be `NULL` on this control path. It can’t be `NULL` if `new_object` is set. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #1767
This commit is contained in:
parent
62b5c738e7
commit
6a1beede60
@ -5606,6 +5606,7 @@ _weak_ref_set (GWeakRef *weak_ref,
|
||||
if (new_object)
|
||||
{
|
||||
#if G_ENABLE_DEBUG
|
||||
g_assert (new_wrdata != NULL);
|
||||
g_assert (weak_ref_data_list_find (new_wrdata, weak_ref) < 0);
|
||||
#endif
|
||||
if (g_atomic_int_get (&new_object->ref_count) < 1)
|
||||
|
Loading…
Reference in New Issue
Block a user