mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibCore+LibWeb: Remove the dummy EventReceiver from deferred_invoke()
The DeferredInvocationContext only existed to satisfy the requirement in ThreadEventQueue that each event has an EventReceiver. However, deferred_invoke() was not even using the EventReceiver to call its callback. Therefore, we don't need to allocate one for every deferred invocation. This also prevents WeakPtr::strong_ref() from racing and leaking the context object when invoking a function across threads.
This commit is contained in:
committed by
Gregory Bertilson
parent
970100e789
commit
b572ae95a9
Notes:
github-actions[bot]
2025-12-03 03:21:58 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b572ae95a91 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6993
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibCore/Forward.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
@@ -25,7 +26,7 @@ public:
|
||||
size_t process();
|
||||
|
||||
// Posts an event to the event queue.
|
||||
void post_event(EventReceiver& receiver, NonnullOwnPtr<Event>);
|
||||
void post_event(EventReceiver*, NonnullOwnPtr<Event>);
|
||||
|
||||
// Used by Threading::BackgroundAction.
|
||||
void add_job(NonnullRefPtr<Promise<NonnullRefPtr<EventReceiver>>>);
|
||||
|
||||
Reference in New Issue
Block a user