[pygobject/gi-boxed-remove-del: 2/3] boxed: don't look up the gtype in to_dealloc, we already know it



commit 4b0a64e2af4839094927e2a794a2cd212a91a313
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Tue Jan 15 13:53:52 2019 +0100

    boxed: don't look up the gtype in to_dealloc, we already know it

 gi/pygi-boxed.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c
index edbe7d04..32fa477c 100644
--- a/gi/pygi-boxed.c
+++ b/gi/pygi-boxed.c
@@ -43,7 +43,6 @@ boxed_dealloc (PyGIBoxed *self)
 static PyObject *
 boxed_del (PyGIBoxed *self)
 {
-    GType g_type;
     gpointer boxed = pyg_boxed_get_ptr (self);
 
     if ( ( (PyGBoxed *) self)->free_on_dealloc && boxed != NULL) {
@@ -52,8 +51,7 @@ boxed_del (PyGIBoxed *self)
             self->slice_allocated = FALSE;
             self->size = 0;
         } else {
-            g_type = pyg_type_from_object ( (PyObject *) self);
-            g_boxed_free (g_type, boxed);
+            g_boxed_free (((PyGBoxed *)self)->gtype, boxed);
         }
     }
     pyg_boxed_set_ptr (self, NULL);


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