|
24 | 24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25 | 25 | */
|
26 | 26 |
|
| 27 | +#include <AK/Badge.h> |
27 | 28 | #include <AK/IDAllocator.h>
|
28 | 29 | #include <AK/JsonObject.h>
|
29 | 30 | #include <AK/JsonValue.h>
|
30 | 31 | #include <AK/Time.h>
|
31 | 32 | #include <LibCore/Event.h>
|
32 | 33 | #include <LibCore/EventLoop.h>
|
| 34 | +#include <LibCore/LocalServer.h> |
33 | 35 | #include <LibCore/LocalSocket.h>
|
34 | 36 | #include <LibCore/Notifier.h>
|
35 | 37 | #include <LibCore/Object.h>
|
@@ -328,7 +330,7 @@ void EventLoop::post_event(Object& receiver, NonnullOwnPtr<Event>&& event)
|
328 | 330 | #ifdef CEVENTLOOP_DEBUG
|
329 | 331 | dbg() << "Core::EventLoop::post_event: {" << m_queued_events.size() << "} << receiver=" << receiver << ", event=" << event;
|
330 | 332 | #endif
|
331 |
| - m_queued_events.append({ receiver.make_weak_ptr(), move(event) }); |
| 333 | + m_queued_events.empend(receiver, move(event)); |
332 | 334 | }
|
333 | 335 |
|
334 | 336 | void EventLoop::wait_for_event(WaitMode mode)
|
@@ -509,4 +511,20 @@ void EventLoop::wake()
|
509 | 511 | }
|
510 | 512 | }
|
511 | 513 |
|
| 514 | +EventLoop::QueuedEvent::QueuedEvent(Object& receiver, NonnullOwnPtr<Event> event) |
| 515 | + : receiver(receiver.make_weak_ptr()) |
| 516 | + , event(move(event)) |
| 517 | +{ |
| 518 | +} |
| 519 | + |
| 520 | +EventLoop::QueuedEvent::QueuedEvent(QueuedEvent&& other) |
| 521 | + : receiver(other.receiver) |
| 522 | + , event(move(other.event)) |
| 523 | +{ |
| 524 | +} |
| 525 | + |
| 526 | +EventLoop::QueuedEvent::~QueuedEvent() |
| 527 | +{ |
| 528 | +} |
| 529 | + |
512 | 530 | }
|
0 commit comments