From 23e4e6f1110c433b5bbec99865c4a5ae089df7e4 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 7 Sep 2005 03:12:10 +0000 Subject: [PATCH] Make sure to hold on to our JS wrapper after wrapping it so it doesn't get GC'ed out from under us. Bug 307279, r=jst, sr=brendan --- dom/src/base/nsDOMClassInfo.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/src/base/nsDOMClassInfo.h b/dom/src/base/nsDOMClassInfo.h index 2ec6d258f64b..2e0b5535e4fb 100644 --- a/dom/src/base/nsDOMClassInfo.h +++ b/dom/src/base/nsDOMClassInfo.h @@ -131,7 +131,10 @@ public: static nsresult WrapNative(JSContext *cx, JSObject *scope, nsISupports *native, const nsIID& aIID, - jsval *vp); + jsval *vp, + // aHolder keeps the jsval alive while + // there's a ref to it + nsIXPConnectJSObjectHolder** aHolder); static nsresult ThrowJSException(JSContext *cx, nsresult aResult); static nsresult InitDOMJSClass(JSContext *cx, JSObject *obj);