Skip to content

Commit

Permalink
make it work with reactive-banana again
Browse files Browse the repository at this point in the history
  • Loading branch information
alios committed Oct 17, 2015
1 parent 4e76e31 commit 7031380
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/gc.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,16 @@ function h$markRetained() {
}

TRACE_GC("mark retained iteration 2/2");
if(w.val !== null) {
w.val = null;
}
if(w.finalizer !== null && !IS_MARKED(w.finalizer)) {
TRACE_GC("following finalizer");
h$follow(w.finalizer);
toFinalize.push(w);
if (IS_MARKED(w)) {
if(w.val !== null) {
w.val = null;
}
if(w.finalizer !== null) {
TRACE_GC("following finalizer");
if (!IS_MARKED(w.finalizer))
h$follow(w.finalizer);
toFinalize.push(w);
}
}
}

Expand Down Expand Up @@ -416,8 +419,6 @@ function h$follow(obj, sp) {
TRACE_GC("adding static marks");
for(var i=0;i<s.length;i++) ADDW(s[i]);
}
} else if(c instanceof h$Weak) {
MARK_OBJ(c);
} else if(c instanceof h$MVar) {
TRACE_GC("marking MVar");
MARK_OBJ(c);
Expand Down

0 comments on commit 7031380

Please sign in to comment.