[pygobject] Fix wrong refcount for GVariant property defaults



commit a107c928ef85b4e3b9075a408774b74879586029
Author: Martin Pitt <martinpitt gnome org>
Date:   Thu Nov 29 13:13:14 2012 +0100

    Fix wrong refcount for GVariant property defaults
    
    Drop the bogus DECREF for the GVariant default argument, as we need to keep it
    around in the class. Otherwise the refcount drops to zero, and the next
    garbage collection run causes segfaults.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689267

 gi/_gobject/gobjectmodule.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
---
diff --git a/gi/_gobject/gobjectmodule.c b/gi/_gobject/gobjectmodule.c
index 479eb93..304a041 100644
--- a/gi/_gobject/gobjectmodule.c
+++ b/gi/_gobject/gobjectmodule.c
@@ -648,7 +648,6 @@ create_property (const gchar  *prop_name,
 		return NULL;
             if (pydefault != Py_None)
                 default_value = pyg_boxed_get (pydefault, GVariant);
-            Py_DECREF(pydefault);
 	    pspec = g_param_spec_variant (prop_name, nick, blurb, G_VARIANT_TYPE_ANY, default_value, flags);
 	}
 	break;



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