diff options
author | Max Kellermann <max@musicpd.org> | 2017-02-09 20:57:14 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-02-09 21:13:19 +0100 |
commit | 29e1b6e4653b4ab65b9fe5326b1df8fe7cb6a1d2 (patch) | |
tree | 13f72ec9216e5ee1aad09ae3c1d02540682ed70f /src/mixer | |
parent | eda06993f8cba429e247cac5e75b1e5938fb3a3e (diff) |
mixer/alsa: reset the MultiSocketMonitor in the destructor
Fixes potential crash bug.
Diffstat (limited to 'src/mixer')
-rw-r--r-- | src/mixer/plugins/AlsaMixerPlugin.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index 4f0e329a8..852326926 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -23,6 +23,7 @@ #include "output/OutputAPI.hxx" #include "event/MultiSocketMonitor.hxx" #include "event/DeferredMonitor.hxx" +#include "event/Call.hxx" #include "util/ASCII.hxx" #include "util/ReusableArray.hxx" #include "util/Domain.hxx" @@ -53,6 +54,12 @@ public: DeferredMonitor::Schedule(); } + ~AlsaMixerMonitor() { + BlockingCall(MultiSocketMonitor::GetEventLoop(), [this](){ + MultiSocketMonitor::Reset(); + }); + } + private: virtual void RunDeferred() override { InvalidateSockets(); |