From 86ec57e6867d43327c4b77a3c8845429b29ab5ce Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 19 Nov 2013 20:04:15 -0500 Subject: [PATCH] Bug 940426 - part 2 - don't observe xpcom-shutdown in nsXULTemplateBuilder; r=bz --- content/xul/templates/src/nsXULTemplateBuilder.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/xul/templates/src/nsXULTemplateBuilder.cpp b/content/xul/templates/src/nsXULTemplateBuilder.cpp index 96e6cdae26d..f21d8407397 100644 --- a/content/xul/templates/src/nsXULTemplateBuilder.cpp +++ b/content/xul/templates/src/nsXULTemplateBuilder.cpp @@ -102,6 +102,7 @@ nsXULTemplateBuilder::nsXULTemplateBuilder(void) mTop(nullptr), mObservedDocument(nullptr) { + MOZ_COUNT_CTOR(nsXULTemplateBuilder); } static PLDHashOperator @@ -128,6 +129,8 @@ nsXULTemplateBuilder::~nsXULTemplateBuilder(void) NS_IF_RELEASE(gScriptSecurityManager); NS_IF_RELEASE(gObserverService); } + + MOZ_COUNT_DTOR(nsXULTemplateBuilder); } @@ -176,7 +179,6 @@ nsXULTemplateBuilder::StartObserving(nsIDocument* aDocument) { aDocument->AddObserver(this); mObservedDocument = aDocument; - gObserverService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); gObserverService->AddObserver(this, DOM_WINDOW_DESTROYED_TOPIC, false); } @@ -186,7 +188,6 @@ nsXULTemplateBuilder::StopObserving() MOZ_ASSERT(mObservedDocument); mObservedDocument->RemoveObserver(this); mObservedDocument = nullptr; - gObserverService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); gObserverService->RemoveObserver(this, DOM_WINDOW_DESTROYED_TOPIC); } @@ -1082,8 +1083,6 @@ nsXULTemplateBuilder::Observe(nsISupports* aSubject, if (doc && doc == mObservedDocument) NodeWillBeDestroyed(doc); } - } else if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) { - UninitTrue(); } return NS_OK; }