Bug 1186940 - Prevent leaking Debugger objects on toolbox close. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 27 Jul 2015 02:07:40 -0700
changeset 254719 6a1fa063e5208ce01d6d3a22c2c93238323daa01
parent 254718 048f102c4dd85cd07409ebd3dd7b7d5b1709182e
child 254720 4eb157aac5859accf4505512fcb80be0d4dcf712
push id29110
push userryanvm@gmail.com
push dateMon, 27 Jul 2015 14:39:38 +0000
treeherdermozilla-central@21ca97268bae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1186940
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1186940 - Prevent leaking Debugger objects on toolbox close. r=jryans
toolkit/devtools/server/actors/utils/make-debugger.js
--- a/toolkit/devtools/server/actors/utils/make-debugger.js
+++ b/toolkit/devtools/server/actors/utils/make-debugger.js
@@ -63,25 +63,25 @@ const { reportException } = require("dev
  *              |findDebuggees|) to the |Debugger| instance.
  */
 module.exports = function makeDebugger({ findDebuggees, shouldAddNewGlobalAsDebuggee }) {
   const dbg = new Debugger();
   EventEmitter.decorate(dbg);
 
   dbg.uncaughtExceptionHook = reportDebuggerHookException;
 
-  dbg.onNewGlobalObject = global => {
+  dbg.onNewGlobalObject = function(global) {
     if (shouldAddNewGlobalAsDebuggee(global)) {
-      safeAddDebuggee(dbg, global);
+      safeAddDebuggee(this, global);
     }
   };
 
-  dbg.addDebuggees = () => {
-    for (let global of findDebuggees(dbg)) {
-      safeAddDebuggee(dbg, global);
+  dbg.addDebuggees = function() {
+    for (let global of findDebuggees(this)) {
+      safeAddDebuggee(this, global);
     }
   };
 
   return dbg;
 };
 
 const reportDebuggerHookException = e => reportException("Debugger Hook", e);