From bd1c233f43315f451cf25cf7656f1a7ff7f12299 Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Sun, 28 Apr 2019 11:55:46 +0300
Subject: [PATCH] Revert "lib: object: allow also using static interfaces using
 the WpObject API"

This reverts commit daa49af541ec448ba8fc01dc493539af229b0c62.
---
 lib/wp/object.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/lib/wp/object.c b/lib/wp/object.c
index c25d535c..0c5a0adc 100644
--- a/lib/wp/object.c
+++ b/lib/wp/object.c
@@ -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);
-- 
GitLab