mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacks
This automatically protects captured objects from being GC'd before the callback runs.
This commit is contained in:
parent
892470a912
commit
6d93e03211
Notes:
sideshowbarker
2024-07-17 02:57:43 +09:00
Author: https://github.com/AtkinsSJ
Commit: 6d93e03211
Pull-request: https://github.com/SerenityOS/serenity/pull/18441
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/nico
Reviewed-by: https://github.com/trflynn89
11 changed files with 19 additions and 19 deletions
|
@ -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> = {});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue