Changeset 97050 in webkit


Ignore:
Timestamp:
Oct 10, 2011, 2:54:02 AM (14 years ago)
Author:
loislo@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r97049 r97050  
     12011-10-10  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: small memory leak in scripts panel.
     4        https://bugs.webkit.org/show_bug.cgi?id=69744
     5
     6        Scripts panel doesn't clean the list of child views.
     7
     8        Reviewed by Yury Semikhatsky.
     9
     10        * inspector/front-end/DebuggerPresentationModel.js:
     11        (WebInspector.DebuggerPresentationModel.prototype._debuggerReset):
     12        * inspector/front-end/ScriptsPanel.js:
     13        (WebInspector.ScriptsPanel.prototype._uiSourceCodeRemoved):
     14
    1152011-10-07  Yury Semikhatsky  <yurys@chromium.org>
    216
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r96694 r97050  
    5757    UISourceCodeAdded: "source-file-added",
    5858    UISourceCodeReplaced: "source-file-replaced",
     59    UISourceCodeRemoved: "source-file-removed",
    5960    ConsoleMessageAdded: "console-message-added",
    6061    ConsoleMessagesCleared: "console-messages-cleared",
     
    431432    _debuggerReset: function()
    432433    {
    433         for (var id in this._rawSourceCode)
     434        for (var id in this._rawSourceCode) {
     435            this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, this._rawSourceCode[id].sourceMapping.uiSourceCode);
    434436            this._rawSourceCode[id].removeAllListeners();
     437        }
    435438        this._rawSourceCode = {};
    436439        this._presentationCallFrames = [];
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r96932 r97050  
    172172    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this)
    173173    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.UISourceCodeReplaced, this._uiSourceCodeReplaced, this);
     174    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this);
    174175    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.ConsoleMessageAdded, this._consoleMessageAdded, this);
    175176    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.ConsoleMessagesCleared, this._consoleMessagesCleared, this);
     
    252253        } else if (uiSourceCode.url === lastViewedURL)
    253254            this._showSourceFrameAndAddToHistory(uiSourceCode);
     255    },
     256
     257    _uiSourceCodeRemoved: function(event)
     258    {
     259        var uiSourceCode = event.data;
     260        if (uiSourceCode._sourceFrame)
     261            this.removeChildView(uiSourceCode._sourceFrame);
    254262    },
    255263
Note: See TracChangeset for help on using the changeset viewer.