Fix for bug 634865 (Non libxul build bustage: undefined reference to xpc_UnmarkGrayObjectRecursive). r+a=jst

This commit is contained in:
Peter Van der Beken 2011-02-18 09:55:47 +01:00
parent 33dd73e29e
commit a1a88cdae4

View File

@ -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<nsINode> node(do_QueryInterface(element));
JSObject *obj;
if (!node || !(obj = node->GetWrapper())) {
nsCOMPtr<nsIXPConnectWrappedNative> 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;
}