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

Unified Diff: third_party/WebKit/Source/devtools/front_end/common/Object.js

Issue 2298473003: DevTools: do not leak memory through event listeners (Closed)
Patch Set: cleanup - some clients have being cleaning event listeners Created 4 years, 4 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/common/Object.js
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Object.js b/third_party/WebKit/Source/devtools/front_end/common/Object.js
index bba17b44d10ec931a83ad3387f2394d93be800ab..86495350547ee75a4d050eeab26791ea2c9dbef9 100644
--- a/third_party/WebKit/Source/devtools/front_end/common/Object.js
+++ b/third_party/WebKit/Source/devtools/front_end/common/Object.js
@@ -167,6 +167,8 @@ WebInspector.EventTarget.removeEventListeners = function(eventList)
var eventInfo = eventList[i];
eventInfo.eventTarget.removeEventListener(eventInfo.eventType, eventInfo.method, eventInfo.receiver);
}
+ // Do not hold references on unused event descriptors.
+ eventList.splice(0, eventList.length);
}
WebInspector.EventTarget.prototype = {

Powered by Google App Engine
This is Rietveld 408576698