ensure garbage collector knows about created objects

This commit is contained in:
Vincent Sanders 2012-11-06 18:06:23 +00:00
parent 733fd39417
commit 4bd5e23fff

View File

@ -38,6 +38,23 @@ binding window {
internal "JSObject *" location;
}
api mark %{
if (private != NULL) {
if (private->document != NULL) {
JS_CallTracer(trc, private->document, JSTRACE_OBJECT);
}
if (private->navigator != NULL) {
JS_CallTracer(trc, private->navigator, JSTRACE_OBJECT);
}
if (private->console != NULL) {
JS_CallTracer(trc, private->console, JSTRACE_OBJECT);
}
if (private->location != NULL) {
JS_CallTracer(trc, private->location, JSTRACE_OBJECT);
}
}
%}
api global %{
%}