From 3c5befde36ea97f84c28b0e77d220bfba5a2373c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 24 Jul 2019 08:38:00 +0200 Subject: [PATCH] CEventLoop: Use NonnullOwnPtr for QueuedEvent::event. We don't allow null events in the event queue. :^) --- Libraries/LibCore/CEventLoop.cpp | 2 +- Libraries/LibCore/CEventLoop.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp index d97bc80cb0..123d3749e2 100644 --- a/Libraries/LibCore/CEventLoop.cpp +++ b/Libraries/LibCore/CEventLoop.cpp @@ -148,7 +148,7 @@ void CEventLoop::pump(WaitMode mode) } } -void CEventLoop::post_event(CObject& receiver, OwnPtr&& event) +void CEventLoop::post_event(CObject& receiver, NonnullOwnPtr&& event) { LOCKER(m_lock); #ifdef CEVENTLOOP_DEBUG diff --git a/Libraries/LibCore/CEventLoop.h b/Libraries/LibCore/CEventLoop.h index f6b90598df..a5370cc428 100644 --- a/Libraries/LibCore/CEventLoop.h +++ b/Libraries/LibCore/CEventLoop.h @@ -30,7 +30,7 @@ public: // this should really only be used for integrating with other event loops void pump(WaitMode = WaitMode::WaitForEvents); - void post_event(CObject& receiver, OwnPtr&&); + void post_event(CObject& receiver, NonnullOwnPtr&&); static CEventLoop& main(); static CEventLoop& current(); @@ -58,7 +58,7 @@ private: struct QueuedEvent { WeakPtr receiver; - OwnPtr event; + NonnullOwnPtr event; }; Vector m_queued_events;