aboutsummaryrefslogtreecommitdiffstats
path: root/src/event
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-06 18:20:42 +0100
committerMax Kellermann <max@duempel.org>2014-01-06 18:21:45 +0100
commit617090cfdaf6acfdef7f2de6cd521559d07d311e (patch)
tree81975061813c3a2f1501bc3f016805046d69546d /src/event
parenta9e604d51df1f30e5423cdb2e5b99cefa2369082 (diff)
downloadmpd-617090cfdaf6acfdef7f2de6cd521559d07d311e.tar.gz
mpd-617090cfdaf6acfdef7f2de6cd521559d07d311e.tar.xz
mpd-617090cfdaf6acfdef7f2de6cd521559d07d311e.zip
event/IdleMonitor: cancel in destructor only if active
Debug-mode workaround for bogus assertion failure.
Diffstat (limited to '')
-rw-r--r--src/event/IdleMonitor.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/event/IdleMonitor.hxx b/src/event/IdleMonitor.hxx
index 8d3928583..dac7ab5b0 100644
--- a/src/event/IdleMonitor.hxx
+++ b/src/event/IdleMonitor.hxx
@@ -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 {