From 4d68a12f036535444532731c2108c0bba723b9e4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 14 Oct 2020 14:47:51 +0200 Subject: [PATCH] event/Loop: split the AtScopeExit() Fixes the !HAVE_THREADED_EVENT_LOOP build. --- src/event/Loop.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index 6d78070a1..49530920e 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -200,20 +200,23 @@ EventLoop::Run() noexcept SocketMonitor::Schedule(SocketMonitor::READ); #endif - AtScopeExit(this) { + #ifdef HAVE_URING + AtScopeExit(this) { /* make sure that the Uring::Manager gets destructed from within the EventThread, or else its destruction in another thread will cause assertion failures */ uring.reset(); uring_initialized = false; + }; #endif #ifdef HAVE_THREADED_EVENT_LOOP + AtScopeExit(this) { SocketMonitor::Cancel(); -#endif }; +#endif do { now = std::chrono::steady_clock::now();