From 19169de44160f8070ee20879a1bdbf3457f43e79 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 1 May 2001 02:56:12 +0000 Subject: [PATCH] fix #76626. leaking nsXULDocument and nsXULTemplateBuilder slows down subscribe dialog the second time, and asserts like mad in debug builds. r=varada, sr=bienvenu (and waterson) --- mailnews/base/resources/content/subscribe.js | 10 ++++++++++ mailnews/base/resources/content/subscribe.xul | 1 + 2 files changed, 11 insertions(+) diff --git a/mailnews/base/resources/content/subscribe.js b/mailnews/base/resources/content/subscribe.js index 0855d601d8c..516e13c96fc 100644 --- a/mailnews/base/resources/content/subscribe.js +++ b/mailnews/base/resources/content/subscribe.js @@ -149,6 +149,16 @@ function SetUpTree(forceToServer) } +function SubscribeOnUnload() +{ + try { + gSubscribeTree.database.RemoveDataSource(subscribeDS); + } + catch (ex) { + dump("failed to remove the subscribe ds: " + ex + "\n"); + } +} + function SubscribeOnLoad() { //dump("SubscribeOnLoad()\n"); diff --git a/mailnews/base/resources/content/subscribe.xul b/mailnews/base/resources/content/subscribe.xul index a51ea682dd9..28a3cb24b18 100644 --- a/mailnews/base/resources/content/subscribe.xul +++ b/mailnews/base/resources/content/subscribe.xul @@ -37,6 +37,7 @@ Rights Reserved. id="subscribeWindow" persist="width height screenX screenY" onload="SubscribeOnLoad()" + onunload="SubscribeOnUnload()" onclose="Stop()">