summaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-06-03 11:55:37 +0100
committerVincent Sanders <vince@netsurf-browser.org>2013-06-03 11:55:37 +0100
commit8d57bb30af6e5f72664c1176155c55ed7198f60e (patch)
tree91d39908ed8d2549075e852f8730355f4e43ef72 /javascript
parent6397fedb2b221aab93d697ed9fc0530dd1415233 (diff)
downloadnetsurf-8d57bb30af6e5f72664c1176155c55ed7198f60e.tar.gz
netsurf-8d57bb30af6e5f72664c1176155c55ed7198f60e.tar.bz2
forcing a GC when the new global is created improves memory usage with scripts enabled
Diffstat (limited to 'javascript')
-rw-r--r--javascript/jsapi/window.bnd3
1 files changed, 3 insertions, 0 deletions
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 %{