mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 404402: Don't remove an XPCTraceableVariant from root set in dtor if it has already been done during unlinking. Patch by peterv. r/sr=sicking
This commit is contained in:
parent
7aaaa8940c
commit
6c25f1dfd7
@ -63,19 +63,20 @@ XPCVariant::XPCVariant(jsval aJSVal)
|
||||
|
||||
XPCTraceableVariant::~XPCTraceableVariant()
|
||||
{
|
||||
NS_ASSERTION(JSVAL_IS_TRACEABLE(mJSVal), "Must be tracaeble");
|
||||
NS_ASSERTION(JSVAL_IS_GCTHING(mJSVal), "Must be traceable or unlinked");
|
||||
|
||||
// If mJSVal is JSVAL_STRING, we don't need to clean anything up;
|
||||
// simply removing the string from the root set is good.
|
||||
if(!JSVAL_IS_STRING(mJSVal))
|
||||
nsVariant::Cleanup(&mData);
|
||||
|
||||
RemoveFromRootSet(nsXPConnect::GetRuntime()->GetJSRuntime());
|
||||
if(!JSVAL_IS_NULL(mJSVal))
|
||||
RemoveFromRootSet(nsXPConnect::GetRuntime()->GetJSRuntime());
|
||||
}
|
||||
|
||||
void XPCTraceableVariant::TraceJS(JSTracer* trc)
|
||||
{
|
||||
NS_ASSERTION(JSVAL_IS_TRACEABLE(mJSVal), "Must be tracaeble");
|
||||
NS_ASSERTION(JSVAL_IS_TRACEABLE(mJSVal), "Must be traceable");
|
||||
JS_SET_TRACING_DETAILS(trc, PrintTraceName, this, 0);
|
||||
JS_CallTracer(trc, JSVAL_TO_TRACEABLE(mJSVal), JSVAL_TRACE_KIND(mJSVal));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user