Skip to content

Commit 88f5ab3

Browse files
author
Elliott Slaughter
committed
gc: Fix for deallocating resources on the shared heap while cleaning stack.
1 parent 3405c54 commit 88f5ab3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libcore/gc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ unsafe fn walk_gc_roots(mem: Memory, visitor: Visitor) {
113113
let refcount = **root;
114114
if mem | task_local_heap != 0 && refcount != -1 {
115115
if !visitor(root, tydesc) { return; }
116-
} else if mem | exchange_heap != 0 {
116+
} else if mem | exchange_heap != 0
117+
&& refcount == -1 {
117118
if !visitor(root, tydesc) { return; }
118119
}
119120
} else {

0 commit comments

Comments
 (0)