Title: [97050] trunk/Source/WebCore
Revision
97050
Author
[email protected]
Date
2011-10-10 02:54:02 -0700 (Mon, 10 Oct 2011)

Log Message

Web Inspector: small memory leak in scripts panel.
https://bugs.webkit.org/show_bug.cgi?id=69744

Scripts panel doesn't clean the list of child views.

Reviewed by Yury Semikhatsky.

* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.prototype._debuggerReset):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._uiSourceCodeRemoved):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97049 => 97050)


--- trunk/Source/WebCore/ChangeLog	2011-10-10 09:33:18 UTC (rev 97049)
+++ trunk/Source/WebCore/ChangeLog	2011-10-10 09:54:02 UTC (rev 97050)
@@ -1,3 +1,17 @@
+2011-10-10  Ilya Tikhonovsky  <[email protected]>
+
+        Web Inspector: small memory leak in scripts panel.
+        https://bugs.webkit.org/show_bug.cgi?id=69744
+
+        Scripts panel doesn't clean the list of child views.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/DebuggerPresentationModel.js:
+        (WebInspector.DebuggerPresentationModel.prototype._debuggerReset):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._uiSourceCodeRemoved):
+
 2011-10-07  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: allow to start WorkerContext paused

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js (97049 => 97050)


--- trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-10-10 09:33:18 UTC (rev 97049)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-10-10 09:54:02 UTC (rev 97050)
@@ -56,6 +56,7 @@
 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 @@
 
     _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;

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (97049 => 97050)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-10-10 09:33:18 UTC (rev 97049)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-10-10 09:54:02 UTC (rev 97050)
@@ -171,6 +171,7 @@
 
     this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this)
     this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.UISourceCodeReplaced, this._uiSourceCodeReplaced, this);
+    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this);
     this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.ConsoleMessageAdded, this._consoleMessageAdded, this);
     this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.ConsoleMessagesCleared, this._consoleMessagesCleared, this);
     this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.BreakpointAdded, this._breakpointAdded, this);
@@ -253,6 +254,13 @@
             this._showSourceFrameAndAddToHistory(uiSourceCode);
     },
 
+    _uiSourceCodeRemoved: function(event)
+    {
+        var uiSourceCode = event.data;
+        if (uiSourceCode._sourceFrame)
+            this.removeChildView(uiSourceCode._sourceFrame);
+    },
+
     _showScriptFoldersSettingChanged: function()
     {
         var selectedOption = this._filesSelectElement[this._filesSelectElement.selectedIndex];
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to