mixer/alsa: reset the MultiSocketMonitor in the destructor

Fixes potential crash bug.
This commit is contained in:
Max Kellermann 2017-02-09 20:57:14 +01:00
parent eda06993f8
commit 29e1b6e465
2 changed files with 9 additions and 0 deletions

2
NEWS
View File

@ -3,6 +3,8 @@ ver 0.20.5 (not yet released)
- id3: fix memory leak on corrupt ID3 tags
* decoder
- sidplay: don't require libsidutils when building with libsidplayfp
* mixer
- alsa: fix crash bug
ver 0.20.4 (2017/02/01)
* input

View File

@ -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();