[gnome-shell] js: use System.gc() instead of shell_global_gc()



commit e756c2dbcec26e101de568b2ef2c16b9250ec9be
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jul 12 19:59:52 2012 -0400

    js: use System.gc() instead of shell_global_gc()
    
    gjs now offers a gc() method in the System module, no need to use our
    own.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679832

 js/perf/core.js       |    4 +++-
 js/ui/lookingGlass.js |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/perf/core.js b/js/perf/core.js
index 6b3b274..cc41c58 100644
--- a/js/perf/core.js
+++ b/js/perf/core.js
@@ -1,5 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const System = imports.system;
+
 const Main = imports.ui.main;
 const Scripting = imports.ui.scripting;
 
@@ -99,7 +101,7 @@ function run() {
         Main.overview.hide();
         yield Scripting.waitLeisure();
 
-        global.gc();
+        System.gc();
         yield Scripting.sleep(1000);
         Scripting.collectStatistics();
         Scripting.scriptEvent('afterShowHide');
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index df994f1..3e6a086 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -12,6 +12,7 @@ const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
+const System = imports.system;
 
 const History = imports.misc.history;
 const ExtensionSystem = imports.ui.extensionSystem;
@@ -665,7 +666,7 @@ const Memory = new Lang.Class({
 
         this._gcbutton = new St.Button({ label: 'Full GC',
                                          style_class: 'lg-obj-inspector-button' });
-        this._gcbutton.connect('clicked', Lang.bind(this, function () { global.gc(); this._renderText(); }));
+        this._gcbutton.connect('clicked', Lang.bind(this, function () { System.gc(); this._renderText(); }));
         this.actor.add(this._gcbutton, { x_align: St.Align.START,
                                          x_fill: false });
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]