Source

thg-qt-mq / gcprint.diff

Full commit
# HG changeset patch
# Parent 3dab56f602e03b6476d27a5a4a2da3f096b9f2a3

diff --git a/tortoisehg/hgqt/run.py b/tortoisehg/hgqt/run.py
--- a/tortoisehg/hgqt/run.py
+++ b/tortoisehg/hgqt/run.py
@@ -387,6 +387,7 @@ class GarbageCollector(QObject):
         gc.disable()
         self.timer.start(self.INTERVAL)
         #gc.set_debug(gc.DEBUG_SAVEALL)
+        gc.set_debug(gc.DEBUG_LEAK)
 
     def check(self):
         #return self.debug_cycles()
@@ -406,6 +407,17 @@ class GarbageCollector(QObject):
                     if self.debug:
                         print 'collecting gen 2, found:', num, 'unreachable'
 
+        for e in gc.garbage:
+            if (isinstance(e, list) or isinstance(e, basestring)
+                or isinstance(e, dict)):
+                continue
+            try:
+                print e
+            except Exception:
+                pass
+        e = None
+        del gc.garbage[:]
+
     def debug_cycles(self):
         gc.collect()
         for obj in gc.garbage: