From 41b1931d9145cd0d6d5aef925b187bc3d25d0b8a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 16 Sep 2023 22:45:23 +0200 Subject: [PATCH] event/Loop: move the poll_backend to the top This is where all sockets are registered, so it should be initialized first and destructed last. --- src/event/Loop.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx index 9278cc327..98901741e 100644 --- a/src/event/Loop.hxx +++ b/src/event/Loop.hxx @@ -44,6 +44,8 @@ class InjectEvent; */ class EventLoop final { + EventPollBackend poll_backend; + #ifdef HAVE_THREADED_EVENT_LOOP WakeFD wake_fd; SocketEvent wake_event{*this, BIND_THIS_METHOD(OnSocketReady), wake_fd.GetSocket()}; @@ -128,8 +130,6 @@ class EventLoop final bool uring_initialized = false; #endif - EventPollBackend poll_backend; - ClockCache steady_clock_cache; public: