Commits

Armin Rigo committed 5b73e19

Fix.

Comments (0)

Files changed (1)

rpython/jit/backend/model.py

 import weakref
+from rpython.rlib import rgc
 from rpython.rlib.debug import debug_start, debug_print, debug_stop
 from rpython.rtyper.lltypesystem import lltype, llmemory
 
         # a list of weakrefs to looptokens that has been redirected to
         # this one
         self.looptokens_redirected_to = []
+        rgc.register_finalizer(self.finalizer)
         debug_start("jit-mem-looptoken-alloc")
         debug_print("allocating Loop #", self.number)
         debug_stop("jit-mem-looptoken-alloc")
         new_loop_tokens.append(weakref.ref(oldlooptoken))
         self.looptokens_redirected_to = new_loop_tokens
 
-    def __del__(self):
+    def finalizer(self):
         #debug_start("jit-mem-looptoken-free")
         #debug_print("freeing Loop #", self.number, 'with',
         #            self.bridges_count, 'attached bridges')