diff --git a/xpcom/threads/nsEventQueue.cpp b/xpcom/threads/nsEventQueue.cpp index 7dc8f08951d..3056a47233a 100644 --- a/xpcom/threads/nsEventQueue.cpp +++ b/xpcom/threads/nsEventQueue.cpp @@ -219,8 +219,11 @@ nsEventQueueImpl::StopAcceptingEvents() void nsEventQueueImpl::NotifyObservers(const char *aTopic) { - nsresult rv; + // we must not invoke the observer service from a background thread! + if (!nsIThread::IsMainThread()) + return; + nsresult rv; nsCOMPtr os = do_GetService("@mozilla.org/observer-service;1", &rv); if (NS_SUCCEEDED(rv)) { nsCOMPtr kungFuDeathGrip(this);