event/IdleMonitor: cancel in destructor only if active

Debug-mode workaround for bogus assertion failure.
This commit is contained in:
Max Kellermann 2014-01-06 18:20:42 +01:00
parent a9e604d51d
commit 617090cfda
1 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,12 @@ public:
:loop(_loop), active(false) {}
~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 {