Commit 617090cf authored by Max Kellermann's avatar Max Kellermann

event/IdleMonitor: cancel in destructor only if active

Debug-mode workaround for bogus assertion failure.
parent a9e604d5
...@@ -45,7 +45,12 @@ public: ...@@ -45,7 +45,12 @@ public:
:loop(_loop), active(false) {} :loop(_loop), active(false) {}
~IdleMonitor() { ~IdleMonitor() {
Cancel(); #ifndef NDEBUG
/* this check is redundant, it is only here to avoid
the assertion in Cancel() */
if (IsActive())
#endif
Cancel();
} }
EventLoop &GetEventLoop() const { EventLoop &GetEventLoop() const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment