mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:27:35 +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
11 changed files with 19 additions and 19 deletions
|
@ -499,7 +499,7 @@ NonnullOwnPtr<JS::ExecutionContext> create_a_new_javascript_realm(JS::VM& vm, Fu
|
|||
return realm_execution_context;
|
||||
}
|
||||
|
||||
void WebEngineCustomData::spin_event_loop_until(Function<bool()> goal_condition)
|
||||
void WebEngineCustomData::spin_event_loop_until(JS::SafeFunction<bool()> goal_condition)
|
||||
{
|
||||
Platform::EventLoopPlugin::the().spin_until(move(goal_condition));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ struct CustomElementReactionsStack {
|
|||
struct WebEngineCustomData final : public JS::VM::CustomData {
|
||||
virtual ~WebEngineCustomData() override = default;
|
||||
|
||||
virtual void spin_event_loop_until(Function<bool()> goal_condition) override;
|
||||
virtual void spin_event_loop_until(JS::SafeFunction<bool()> goal_condition) override;
|
||||
|
||||
HTML::EventLoop event_loop;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue