From 8d57bb30af6e5f72664c1176155c55ed7198f60e Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 3 Jun 2013 11:55:37 +0100 Subject: forcing a GC when the new global is created improves memory usage with scripts enabled --- javascript/jsapi/window.bnd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index d06e7d478..5de0e5bf0 100644 --- a/javascript/jsapi/window.bnd +++ b/javascript/jsapi/window.bnd @@ -252,6 +252,9 @@ api init %{ /* add properties to prototype */ if (!JS_DefineProperties(cx, prototype, jsclass_properties)) return NULL; + + /* as the global just got changed, force a GC run */ + JS_GC(cx); %} api new %{ -- cgit v1.2.3