From a1a88cdae4dd948cbd7789f5905a15dbdfb1430f Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Fri, 18 Feb 2011 09:55:47 +0100 Subject: [PATCH] Fix for bug 634865 (Non libxul build bustage: undefined reference to xpc_UnmarkGrayObjectRecursive). r+a=jst --- modules/plugin/base/src/nsJSNPRuntime.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/plugin/base/src/nsJSNPRuntime.cpp b/modules/plugin/base/src/nsJSNPRuntime.cpp index 5abd0e43dbca..1618855f496e 100644 --- a/modules/plugin/base/src/nsJSNPRuntime.cpp +++ b/modules/plugin/base/src/nsJSNPRuntime.cpp @@ -56,7 +56,6 @@ #include "nsIDOMElement.h" #include "prmem.h" #include "nsIContent.h" -#include "xpcpublic.h" using namespace mozilla::plugins::parent; @@ -2038,18 +2037,20 @@ nsJSNPRuntime::OnPluginDestroy(NPP npp) return; } - nsCOMPtr node(do_QueryInterface(element)); - - JSObject *obj; - if (!node || !(obj = node->GetWrapper())) { + nsCOMPtr holder; + xpc->GetWrappedNativeOfNativeObject(cx, sgo->GetGlobalJSObject(), content, + NS_GET_IID(nsISupports), + getter_AddRefs(holder)); + if (!holder) { return; } - JSObject *proto; + JSObject *obj, *proto; + holder->GetJSObject(&obj); JSAutoEnterCompartment ac; - if (!ac.enter(cx, obj)) { + if (obj && !ac.enter(cx, obj)) { // Failure to enter compartment, nothing more we can do then. return; }