From 1fd6b4e56bd6f0e50c662bdeff744f49a9d9c70f Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Thu, 4 Nov 2004 02:34:11 +0000 Subject: [PATCH] fixes bug 234620 "Unknown random SEGV/seg fault/core dumps/crashes, only thing on is Mail/IMAP" r=dbaron sr=bienvenu --- xpcom/threads/nsEventQueue.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);