summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-04-21 12:13:04 +0100
committerLinus Groh <mail@linusgroh.de>2023-04-21 20:44:47 +0100
commit6d93e03211795d8285d7bbd3a8e1b6fe458262e8 (patch)
tree1b7dfa81817e5a148595412a20f161072dbddbca /Userland/Libraries/LibJS
parent892470a91228e01d973230cd76327bbf5187319e (diff)
downloadserenity-6d93e03211795d8285d7bbd3a8e1b6fe458262e8.zip
LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacks
This automatically protects captured objects from being GC'd before the callback runs.
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Runtime/VM.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h
index eb1dca8ff8..6880ab4f2a 100644
--- a/Userland/Libraries/LibJS/Runtime/VM.h
+++ b/Userland/Libraries/LibJS/Runtime/VM.h
@@ -35,7 +35,7 @@ public:
struct CustomData {
virtual ~CustomData() = default;
- virtual void spin_event_loop_until(Function<bool()> goal_condition) = 0;
+ virtual void spin_event_loop_until(JS::SafeFunction<bool()> goal_condition) = 0;
};
static ErrorOr<NonnullRefPtr<VM>> create(OwnPtr<CustomData> = {});