Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js

Issue 2301023003: DevTools: fix disposing of main debugger script mappings (Closed)
Patch Set: main debugger mappings do not leak memory Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
index 78f6ebd7e0c9f633cbd13171b33ed82c6728f53d..256dc7a1e1811371943f940f77c11be7b1119f2f 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
@@ -385,8 +385,10 @@ WebInspector.DebuggerWorkspaceBinding.TargetData = function(debuggerModel, debug
/** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.DebuggerSourceMapping>} */
this._uiSourceCodeToSourceMapping = new Map();
- debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this);
- debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this);
+ this._eventListeners = [
+ debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this),
+ debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this)
+ ];
}
WebInspector.DebuggerWorkspaceBinding.TargetData.prototype = {
@@ -453,6 +455,7 @@ WebInspector.DebuggerWorkspaceBinding.TargetData.prototype = {
_dispose: function()
{
+ WebInspector.EventTarget.removeEventListeners(this._eventListeners);
this._compilerMapping.dispose();
this._resourceMapping.dispose();
this._defaultMapping.dispose();

Powered by Google App Engine
This is Rietveld 408576698