Bug 259688: Crash [@nsCOMPtr_base::~nsCOMPtr_base] [@ 0x003a0043] installing themes and extensions. r+sr=dveditz

This commit is contained in:
dtownsend@oxymoronical.com 2007-09-30 06:06:54 -07:00
parent f512f68c0b
commit 80e99ab94d

View File

@ -121,10 +121,6 @@ nsXPInstallManager::nsXPInstallManager()
// initialize mLastUpdate to the current time
mLastUpdate = PR_Now();
nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));
if (os)
os->AddObserver(this, XPI_PROGRESS_TOPIC, PR_TRUE);
}
@ -178,6 +174,10 @@ nsXPInstallManager::InitManagerWithHashes(const PRUnichar **aURLs,
mNeedsShutdown = PR_TRUE;
nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));
if (os)
os->AddObserver(this, XPI_PROGRESS_TOPIC, PR_TRUE);
for (PRUint32 i = 0; i < aURLCount; ++i)
{
nsXPITriggerItem* item = new nsXPITriggerItem(0, aURLs[i], nsnull,
@ -341,6 +341,10 @@ nsXPInstallManager::InitManagerInternal()
if (OKtoInstall)
{
nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));
if (os)
os->AddObserver(this, XPI_PROGRESS_TOPIC, PR_TRUE);
//-----------------------------------------------------
// Open the progress dialog
//-----------------------------------------------------