Imported Upstream version 3.7.91.1
[platform/upstream/pygobject2.git] / gi / overrides / GLib.py
index b3f1563..3e660d1 100644 (file)
@@ -539,6 +539,10 @@ class Source(GLib.Source):
         setattr(source, '__pygi_custom_source', True)
         return source
 
+    def __del__(self):
+        if hasattr(self, '__pygi_custom_source'):
+            self.unref()
+
     # Backwards compatible API for optional arguments
     def attach(self, context=None):
         id = super(Source, self).attach(context)