changeset 15:351525e95a45

Added memory leak detection.
author Atul Varma <varmaa@toolness.com>
date Sun, 06 Sep 2009 14:59:58 -0700
parents 9bcbf780581f
children a78570a423ea
files pydershell/pydershell.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pydershell/pydershell.py	Sun Sep 06 14:55:22 2009 -0700
+++ b/pydershell/pydershell.py	Sun Sep 06 14:59:58 2009 -0700
@@ -183,3 +183,8 @@
     runtime = JSRuntime()
     runtime.run_script('test.js')
     del runtime
+
+    import gc
+    gc.collect()
+    if pydermonkey.get_debug_info()['runtime_count']:
+        print "WARNING: JS runtime was not destroyed."