[pygobject] Unref GVariants when destroying the wrapper



commit 8c7306e4d6355ca45f8f1b4adf7d0595b4e8bcf8
Author: Martin Pitt <martinpitt gnome org>
Date:   Sat May 5 09:28:36 2012 +0200

    Unref GVariants when destroying the wrapper
    
    https://bugzilla.gnome.org/show_bug.cgi?id=675472

 gi/overrides/GLib.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index 41904c8..dcb2728 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -171,6 +171,9 @@ class Variant(GLib.Variant):
             raise TypeError('invalid remaining format string: "%s"' % rest_format)
         return v
 
+    def __del__(self):
+        self.unref()
+
     def __repr__(self):
         return '<GLib.Variant(%s)>' % getattr(self, 'print')(True)
 



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