summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore/EventLoop.cpp
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2021-08-30 10:43:28 +0000
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-09-02 03:47:47 +0430
commite9121f8b1f9d31f0da89f34eac69a7da9f2901a0 (patch)
tree5e7087354e3a34b0f8494c60a16dfd64d5221a77 /Userland/Libraries/LibCore/EventLoop.cpp
parentac24842f4895c9b7b46b217617407841cca2334f (diff)
downloadserenity-e9121f8b1f9d31f0da89f34eac69a7da9f2901a0.zip
LibCore+Userland: Implement Core::deferred_invoke
Core::deferred_invoke is a way of executing an action after previously queued events have been processed. It removes the requirement of having/being a Core::Object subclass in order to defer invocation through Core::Object::deferred_invoke. Core::Object::deferred_invoke now delegates to Core::deferred_invoke. The version with the Object& argument is still present but will be removed in the following commits. This commit additionally fixes a new places where the DeferredInvocationEvent was dispatched to the event loop directly, and replaces them with the Core::deferred_invoke equivalent.
Diffstat (limited to 'Userland/Libraries/LibCore/EventLoop.cpp')
-rw-r--r--Userland/Libraries/LibCore/EventLoop.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp
index 436aba6ee5..081c34acdb 100644
--- a/Userland/Libraries/LibCore/EventLoop.cpp
+++ b/Userland/Libraries/LibCore/EventLoop.cpp
@@ -394,7 +394,7 @@ void EventLoop::pump(WaitMode mode)
}
} else if (event.type() == Event::Type::DeferredInvoke) {
dbgln_if(DEFERRED_INVOKE_DEBUG, "DeferredInvoke: receiver = {}", *receiver);
- static_cast<DeferredInvocationEvent&>(event).m_invokee(*receiver);
+ static_cast<DeferredInvocationEvent&>(event).m_invokee();
} else {
NonnullRefPtr<Object> protector(*receiver);
receiver->dispatch_event(event);