object-interest: initialize GValue passed to g_object_get_property

g_object_get_property did not support uninitialized GValues prior
to GLib 2.60, and it's not worth requiring 2.60 for this reason

Fixes #11
This commit is contained in:
George Kiagiadakis 2020-06-16 19:16:04 +03:00
parent 707518937a
commit 1563eeeae6

View file

@ -761,11 +761,14 @@ wp_object_interest_matches_full (WpObjectInterest * self,
}
case WP_CONSTRAINT_TYPE_G_PROPERTY: {
GType value_type;
GParamSpec *pspec = NULL;
if (object)
exists = !!g_object_class_find_property (G_OBJECT_GET_CLASS (object), c->subject);
exists = !!(pspec = g_object_class_find_property (
G_OBJECT_GET_CLASS (object), c->subject));
if (exists && c->subject_type) {
g_value_init (&value, pspec->value_type);
g_object_get_property (object, c->subject, &value);
value_type = G_VALUE_TYPE (&value);