Web Inspector: small memory leak in scripts panel.
[WebKit-https.git] / Source / WebCore / inspector / front-end / DebuggerPresentationModel.js
index 25302d0a01bdcbc8e7146fc168ac2b14101552f9..a728e98f0e44d9d5dd08feb052dee08f0fe5793c 100644 (file)
@@ -56,6 +56,7 @@ WebInspector.DebuggerPresentationModel = function()
 WebInspector.DebuggerPresentationModel.Events = {
     UISourceCodeAdded: "source-file-added",
     UISourceCodeReplaced: "source-file-replaced",
+    UISourceCodeRemoved: "source-file-removed",
     ConsoleMessageAdded: "console-message-added",
     ConsoleMessagesCleared: "console-messages-cleared",
     BreakpointAdded: "breakpoint-added",
@@ -430,8 +431,10 @@ WebInspector.DebuggerPresentationModel.prototype = {
 
     _debuggerReset: function()
     {
-        for (var id in this._rawSourceCode)
+        for (var id in this._rawSourceCode) {
+            this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, this._rawSourceCode[id].sourceMapping.uiSourceCode);
             this._rawSourceCode[id].removeAllListeners();
+        }
         this._rawSourceCode = {};
         this._presentationCallFrames = [];
         this._selectedCallFrame = null;