event/Loop: destruct the Uring::Manager in the destructor before assert()

Fixes assertion failure when the EventLoop gets destructed before
Run() was ever called.

Fixes https://bugs.debian.org/998310
This commit is contained in:
Max Kellermann 2021-11-03 18:27:12 +01:00
parent 67aff05051
commit 14b3c0f0af
2 changed files with 8 additions and 0 deletions

1
NEWS
View File

@ -1,4 +1,5 @@
ver 0.23.4 (not yet released)
* fix crash or debug builds if startup fails
ver 0.23.3 (2021/10/31)
* protocol

View File

@ -52,6 +52,13 @@ EventLoop::EventLoop(
EventLoop::~EventLoop() noexcept
{
#if defined(HAVE_URING) && !defined(NDEBUG)
/* if Run() was never called (maybe because startup failed and
an exception is pending), we need to destruct the
Uring::Manager here or else the assertions below fail */
uring.reset();
#endif
assert(defer.empty());
assert(idle.empty());
#ifdef HAVE_THREADED_EVENT_LOOP