From 544801113f2eb1535821f2c4c40d25ab012fc062 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Mon, 23 Apr 2012 14:14:10 -0700 Subject: [PATCH] Bug 747245: Fix a silly weak reference assertion. r=bent a=mfinkle --- js/xpconnect/src/XPCJSWeakReference.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/xpconnect/src/XPCJSWeakReference.cpp b/js/xpconnect/src/XPCJSWeakReference.cpp index f58b4ae01ff..d26becb0aff 100644 --- a/js/xpconnect/src/XPCJSWeakReference.cpp +++ b/js/xpconnect/src/XPCJSWeakReference.cpp @@ -60,8 +60,10 @@ nsresult xpcJSWeakReference::Init(JSContext* cx, const JS::Value& object) // See if the object is a wrapped native that supports weak references. nsISupports* supports = nsXPConnect::GetXPConnect()->GetNativeOfWrapper(cx, &obj); - if (supports) { - mReferent = do_GetWeakReference(supports); + nsCOMPtr supportsWeakRef = + do_QueryInterface(supports); + if (supportsWeakRef) { + supportsWeakRef->GetWeakReference(getter_AddRefs(mReferent)); if (mReferent) { return NS_OK; }