Skip to content
Snippets Groups Projects
Commit bd1c233f authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

Revert "lib: object: allow also using static interfaces using the WpObject API"

This reverts commit daa49af5.
parent 41b1f400
No related branches found
No related tags found
No related merge requests found
......@@ -21,20 +21,9 @@ static void
wp_object_init (WpObject * self)
{
WpObjectPrivate *priv = wp_object_get_instance_private (self);
g_autofree GType *static_ifaces;
guint n_static_ifaces, i;
priv->iface_objects = g_array_new (FALSE, FALSE, sizeof (gpointer));
priv->iface_types = g_array_new (FALSE, FALSE, sizeof (GType));
static_ifaces = g_type_interfaces (G_TYPE_FROM_INSTANCE (self),
&n_static_ifaces);
if (n_static_ifaces > 0) {
g_array_append_vals (priv->iface_types, static_ifaces, n_static_ifaces);
for (i = 0; i < n_static_ifaces; i++) {
g_array_append_val (priv->iface_objects, self);
}
}
}
static void
......@@ -45,11 +34,9 @@ wp_object_finalize (GObject * obj)
guint i;
for (i = 0; i < priv->iface_objects->len; i++) {
GObject *o = g_array_index (priv->iface_objects, GObject*, i);
if (o != obj) {
wp_interface_impl_set_object (WP_INTERFACE_IMPL (o), NULL);
g_object_unref (o);
}
GObject *obj = g_array_index (priv->iface_objects, GObject*, i);
wp_interface_impl_set_object (WP_INTERFACE_IMPL (obj), NULL);
g_object_unref (obj);
}
g_array_free (priv->iface_objects, TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment