B2G/gecko/browser/devtools/webconsole/HUDService.jsm
/**
   * Destroy the object. Call this method to avoid memory leaks when the Web
   * Console is closed.
   *
   * @param function [aOnDestroy]
   *        Optional function to invoke when the Web Console instance is
   *        destroyed.
   */
Destroy the object. Call this method to avoid memory leaks when the Web
Console is closed.

@param function [aOnDestroy]
Optional function to invoke when the Web Console instance is
destroyed.
Destroy the object . Call this method to avoid memory leaks when the Web Console is closed . @param function [ aOnDestroy ] Optional function to invoke when the Web Console instance is destroyed .
function WC_destroy(aOnDestroy)
  {
    this.consoleWindowUnregisterOnHide = false;
    let popupset = this.mainPopupSet;
    let panels = popupset.querySelectorAll("panel[hudId=" + this.hudId + "]");
    for (let panel of panels) {
      if (panel != this.consolePanel) {
        panel.hidePopup();
      }
    }
    let onDestroy = function WC_onDestroyUI() {
      if (this.consolePanel && this.consolePanel.parentNode) {
        this.consolePanel.hidePopup();
        this.consolePanel.parentNode.removeChild(this.consolePanel);
        this.consolePanel = null;
      }
      if (this.iframe.parentNode) {
        this.iframe.parentNode.removeChild(this.iframe);
      }
      if (this.splitter.parentNode) {
        this.splitter.parentNode.removeChild(this.splitter);
      }
      aOnDestroy && aOnDestroy();
    }.bind(this);
    if (this.ui) {
      this.ui.destroy(onDestroy);
    }
    else {
      onDestroy();
    }
  }
function WC_destroy ( aOnDestroy ) { this . consoleWindowUnregisterOnHide = false ; let popupset = this . mainPopupSet ; let panels = popupset . querySelectorAll ( "panel[hudId=" + this . hudId + "]" ) ; for ( let panel of panels ) { if ( panel != this . consolePanel ) { panel . hidePopup ( ) ; } } let onDestroy = function WC_onDestroyUI ( ) { if ( this . consolePanel && this . consolePanel . parentNode ) { this . consolePanel . hidePopup ( ) ; this . consolePanel . parentNode . removeChild ( this . consolePanel ) ; this . consolePanel = null ; } if ( this . iframe . parentNode ) { this . iframe . parentNode . removeChild ( this . iframe ) ; } if ( this . splitter . parentNode ) { this . splitter . parentNode . removeChild ( this . splitter ) ; } aOnDestroy && aOnDestroy ( ) ; } . bind ( this ) ; if ( this . ui ) { this . ui . destroy ( onDestroy ) ; } else { onDestroy ( ) ; } }
Destroy the object.
Destroy the object .
// Make sure that the console panel does not try to call // deactivateHUDForContext() again. // Remove the iframe and the consolePanel if the Web Console is inside a // floating panel.