mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 921553. Fix some binding rooting hazards that have popped up. r=peterv
This commit is contained in:
parent
44f1bc368f
commit
51daf6d4ad
@ -2085,7 +2085,7 @@ ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
|
||||
JS::MutableHandle<JS::Value> pval, bool nullable,
|
||||
nsACString& result)
|
||||
{
|
||||
JSString *s;
|
||||
JS::Rooted<JSString*> s(cx);
|
||||
if (v.isString()) {
|
||||
s = v.toString();
|
||||
} else {
|
||||
|
@ -6151,18 +6151,24 @@ def getUnionTypeTemplateVars(unionType, type, descriptorProvider,
|
||||
body=body)
|
||||
|
||||
else:
|
||||
# Important: we need to not have our declName involve
|
||||
# maybe-GCing operations.
|
||||
jsConversion = string.Template(conversionInfo.template).substitute(
|
||||
{
|
||||
"val": "value",
|
||||
"mutableVal": "pvalue",
|
||||
"declName": "SetAs" + name + "(%s)" % ctorArgs,
|
||||
"declName": "memberSlot",
|
||||
"holderName": "m" + name + "Holder",
|
||||
}
|
||||
)
|
||||
jsConversion = CGWrapper(CGGeneric(jsConversion),
|
||||
pre="tryNext = false;\n",
|
||||
post="\n"
|
||||
"return true;")
|
||||
jsConversion = CGWrapper(CGIndenter(CGGeneric(jsConversion)),
|
||||
pre=("tryNext = false;\n"
|
||||
"{ // scope for memberSlot\n"
|
||||
" %s& memberSlot = SetAs%s(%s);\n"
|
||||
% (structType, name, ctorArgs)),
|
||||
post=("\n"
|
||||
"}\n"
|
||||
"return true;"))
|
||||
setter = ClassMethod("TrySetTo" + name, "bool",
|
||||
[Argument("JSContext*", "cx"),
|
||||
Argument("JS::Handle<JS::Value>", "value"),
|
||||
|
Loading…
Reference in New Issue
Block a user