mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-01 05:13:06 +02:00
Merge branch 'coverity-is-stupid' into 'main'
gobject: Change GObject notify semantics under static analysis See merge request GNOME/glib!2747
This commit is contained in:
commit
b2f4df95e8
@ -1527,13 +1527,24 @@ g_object_notify_by_spec_internal (GObject *object,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Coverity doesn’t understand the paired ref/unref here and seems to
|
||||||
|
* ignore the ref, thus reports every call to g_object_notify() as
|
||||||
|
* causing a double-free. That’s incorrect, but I can’t get a model
|
||||||
|
* file to work for avoiding the false positives, so instead comment
|
||||||
|
* out the ref/unref when doing static analysis.
|
||||||
|
*/
|
||||||
|
#ifndef __COVERITY__
|
||||||
g_object_ref (object);
|
g_object_ref (object);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* not frozen, so just dispatch the notification directly */
|
/* not frozen, so just dispatch the notification directly */
|
||||||
G_OBJECT_GET_CLASS (object)
|
G_OBJECT_GET_CLASS (object)
|
||||||
->dispatch_properties_changed (object, 1, &pspec);
|
->dispatch_properties_changed (object, 1, &pspec);
|
||||||
|
|
||||||
|
#ifndef __COVERITY__
|
||||||
g_object_unref (object);
|
g_object_unref (object);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user