mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 947336, part 2 - Make nsXPCWrappedJS::mClass a smart pointer. r=bholley
This commit is contained in:
parent
d9c65a6e80
commit
1d5a828eca
@ -434,8 +434,6 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
|
||||
NS_ADDREF_THIS();
|
||||
NS_ADDREF_THIS();
|
||||
|
||||
NS_ADDREF(aClass);
|
||||
|
||||
if (!IsRootWrapper())
|
||||
NS_ADDREF(mRoot);
|
||||
|
||||
@ -496,7 +494,7 @@ nsXPCWrappedJS::Unlink()
|
||||
NS_RELEASE(mRoot);
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(mClass);
|
||||
mClass = nullptr;
|
||||
if (mOuter) {
|
||||
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
||||
if (rt->GCIsRunning()) {
|
||||
@ -647,7 +645,7 @@ nsXPCWrappedJS::DebugDump(int16_t depth)
|
||||
XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid"));
|
||||
if (iid)
|
||||
NS_Free(iid);
|
||||
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x", mClass));
|
||||
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x", mClass.get()));
|
||||
|
||||
if (!IsRootWrapper())
|
||||
XPC_LOG_OUTDENT();
|
||||
|
@ -2535,7 +2535,7 @@ protected:
|
||||
|
||||
private:
|
||||
JS::Heap<JSObject*> mJSObj;
|
||||
nsXPCWrappedJSClass* mClass;
|
||||
nsRefPtr<nsXPCWrappedJSClass> mClass;
|
||||
nsXPCWrappedJS* mRoot;
|
||||
nsXPCWrappedJS* mNext;
|
||||
nsCOMPtr<nsISupports> mOuter; // only set in root
|
||||
|
Loading…
Reference in New Issue
Block a user