From f407a3d903dee688a43c7aa702cfcd2db7275faf Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Thu, 1 Mar 2018 14:53:01 +0200 Subject: [PATCH] fix(panel) memory leak When destroying md-tooltip the callback `onDomAdded` remained attached and was causing a memory leak. Added 4 lines with setting all 4 callbacks to null in `MdPanelRef.prototype.destroy`. Fixes #11133 --- src/components/panel/panel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/panel/panel.js b/src/components/panel/panel.js index ea458c3d0df..bd7b36e9419 100644 --- a/src/components/panel/panel.js +++ b/src/components/panel/panel.js @@ -1608,6 +1608,10 @@ MdPanelRef.prototype.destroy = function() { } this.config.scope.$destroy(); this.config.locals = null; + this.config.onDomAdded = null; + this.config.onDomRemoved = null; + this.config.onRemoving = null; + this.config.onOpenComplete = null; this._interceptors = null; };