[glib/finalize-speedups: 3/4] gobject: Don't do duplicate work




commit 488bdb8e7fad45f78eab9148c4fea6d9cdfa066b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 22 07:25:20 2022 -0400

    gobject: Don't do duplicate work
    
    We already remove the signal handlers and
    weak refs in g_object_real_dispose. No need
    to do it again after dispose, and before
    the data is cleaned out for good in finalize.

 gobject/gobject.c | 9 ---------
 1 file changed, 9 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index e710afc292..a52e43167b 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -3682,15 +3682,6 @@ g_object_unref (gpointer _object)
        }
 
       /* we are still in the process of taking away the last ref */
-      g_signal_handlers_destroy (object);
-      {
-        GQuark keys[3] = {
-          quark_closure_array,
-          quark_weak_refs,
-          quark_weak_locations,
-        };
-        g_datalist_id_remove_multiple (&object->qdata, keys, G_N_ELEMENTS (keys));
-      }
 
       /* decrement the last reference */
       old_ref = g_atomic_int_add (&object->ref_count, -1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]