Revert "LibThreading: Fix BackgroundAction result use-after-free"

This reverts commit b2e6088bff.

This was a speculative fix that ended up not fixing the issue.
This commit is contained in:
Andreas Kling 2021-07-12 11:29:37 +02:00
parent 026ffa343d
commit 2e3df52862
Notes: sideshowbarker 2024-07-18 09:12:11 +09:00

View file

@ -66,8 +66,8 @@ private:
enqueue_work([this] {
m_result = m_action(*this);
if (m_on_complete) {
Core::EventLoop::current().post_event(*this, make<Core::DeferredInvocationEvent>([this, result = m_result.release_value()](auto&) {
m_on_complete(result);
Core::EventLoop::current().post_event(*this, make<Core::DeferredInvocationEvent>([this](auto&) {
m_on_complete(m_result.release_value());
this->remove_from_parent();
}));
Core::EventLoop::wake();