diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-02-09 21:38:43 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-03-05 14:06:28 +0100 |
commit | eade82695ffdf4892ded27c50dccc482df8086a2 (patch) | |
tree | c2ac105305e682d19fa1ceea6afd8de5ab501044 | |
parent | 241b8693d69c73b1177235830049d470aa056aa1 (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>
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 4 |
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(); } |