From 677290f8fb93012a56c9bb3bea6b3badd80afce4 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 22 Aug 2011 17:20:52 -0400 Subject: [PATCH] Bug 681061 - Avoid compartment mismatch error when displaying a growl notification. r=mrbkap --- toolkit/components/alerts/mac/mozGrowlDelegate.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolkit/components/alerts/mac/mozGrowlDelegate.mm b/toolkit/components/alerts/mac/mozGrowlDelegate.mm index 1d5f913d765a..4cf982c05d6e 100644 --- a/toolkit/components/alerts/mac/mozGrowlDelegate.mm +++ b/toolkit/components/alerts/mac/mozGrowlDelegate.mm @@ -79,6 +79,10 @@ GetWindowOfObserver(nsIObserver* aObserver) NS_ENSURE_SUCCESS(rv, nsnull); JSAutoRequest ar(cx); + JSAutoEnterCompartment ac; + if (!ac.enter(cx, obj)) { + return nsnull; + } JSObject* global = JS_GetGlobalForObject(cx, obj); NS_ENSURE_TRUE(global, nsnull);