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




commit b02877585125892831678f11dab2b176c66ad98d
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 | 6 ------
 1 file changed, 6 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index b70d7e5999..f9a091ce16 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -3665,12 +3665,6 @@ g_object_unref (gpointer _object)
          return;
        }
 
-      /* we are still in the process of taking away the last ref */
-      g_datalist_id_set_data (&object->qdata, quark_closure_array, NULL);
-      g_signal_handlers_destroy (object);
-      g_datalist_id_set_data (&object->qdata, quark_weak_refs, NULL);
-      g_datalist_id_set_data (&object->qdata, quark_weak_locations, NULL);
-
       /* decrement the last reference */
       old_ref = g_atomic_int_add (&object->ref_count, -1);
       g_return_if_fail (old_ref > 0);


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