diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-04-21 12:13:04 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-04-21 20:44:47 +0100 |
commit | 6d93e03211795d8285d7bbd3a8e1b6fe458262e8 (patch) | |
tree | 1b7dfa81817e5a148595412a20f161072dbddbca /Userland/Libraries/LibJS | |
parent | 892470a91228e01d973230cd76327bbf5187319e (diff) | |
download | serenity-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.h | 2 |
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> = {}); |