fixes bug 279852 "nsWeakReference not threadsafe assertions due to TimerThread::Init" r=sfraser sr=bryner

git-svn-id: svn://10.0.0.236/trunk@170623 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%meer.net
2005-03-14 06:37:01 +00:00
parent 0ae1bda239
commit c8afb22653
2 changed files with 5 additions and 14 deletions

View File

@@ -47,7 +47,7 @@
#include "nsIObserverService.h"
#include "nsIServiceManager.h"
NS_IMPL_THREADSAFE_ISUPPORTS3(TimerThread, nsIRunnable, nsISupportsWeakReference, nsIObserver)
NS_IMPL_THREADSAFE_ISUPPORTS2(TimerThread, nsIRunnable, nsIObserver)
TimerThread::TimerThread() :
mInitInProgress(0),
@@ -77,13 +77,6 @@ TimerThread::~TimerThread()
nsTimerImpl *timer = NS_STATIC_CAST(nsTimerImpl *, mTimers[n]);
NS_RELEASE(timer);
}
nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");
if (observerService) {
observerService->RemoveObserver(this, "sleep_notification");
observerService->RemoveObserver(this, "wake_notification");
}
}
nsresult
@@ -131,8 +124,9 @@ nsresult TimerThread::Init()
mThread = nsnull;
}
else {
observerService->AddObserver(this, "sleep_notification", PR_TRUE);
observerService->AddObserver(this, "wake_notification", PR_TRUE);
// We'll be released at xpcom shutdown
observerService->AddObserver(this, "sleep_notification", PR_FALSE);
observerService->AddObserver(this, "wake_notification", PR_FALSE);
}
}
}