aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2024-02-09 21:38:43 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2024-03-05 14:06:28 +0100
commiteade82695ffdf4892ded27c50dccc482df8086a2 (patch)
treec2ac105305e682d19fa1ceea6afd8de5ab501044 /src/qml/jsruntime
parent241b8693d69c73b1177235830049d470aa056aa1 (diff)
Prepare for white allocation during gc (4/9): BoundFunction
Put the newly created FunctionObject into a Scope. This isn't actually needed, but acts as a safeguard in case FunctionObject::function is changed in the future to allocate memory. Change-Id: I5bcd888cd8bd5cb8c727eb3b29222981c851d4fe Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index b4ae7c078a..b5a3934528 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -428,8 +428,8 @@ ReturnedValue FunctionPrototype::method_bind(const FunctionObject *b, const Valu
}
ScopedContext ctx(scope, target->scope());
- Heap::BoundFunction *bound = BoundFunction::create(ctx, target, boundThis, boundArgs);
- bound->setFunction(target->function());
+ Scoped<BoundFunction> bound(scope, BoundFunction::create(ctx, target, boundThis, boundArgs));
+ bound->d()->setFunction(target->function());
return bound->asReturnedValue();
}