From 88f5ab31635855595e4053cb64153e6bb7ec622b Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 22 Aug 2012 16:55:48 -0700 Subject: [PATCH] gc: Fix for deallocating resources on the shared heap while cleaning stack. --- src/libcore/gc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcore/gc.rs b/src/libcore/gc.rs index 697c6fcdfb49..741fa4de1225 100644 --- a/src/libcore/gc.rs +++ b/src/libcore/gc.rs @@ -113,7 +113,8 @@ unsafe fn walk_gc_roots(mem: Memory, visitor: Visitor) { let refcount = **root; if mem | task_local_heap != 0 && refcount != -1 { if !visitor(root, tydesc) { return; } - } else if mem | exchange_heap != 0 { + } else if mem | exchange_heap != 0 + && refcount == -1 { if !visitor(root, tydesc) { return; } } } else {