From 20ae84bff9db62f29d2b23a4b06f0c65641d0f84 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Feb 2017 15:05:49 +0100 Subject: [PATCH] {input,mixer}/alsa: cancel the DeferredMonitor in the destructor Yet another potential crash bug fix. --- src/input/plugins/AlsaInputPlugin.cxx | 1 + src/mixer/plugins/AlsaMixerPlugin.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx index 40967dd40..4cbf1644c 100644 --- a/src/input/plugins/AlsaInputPlugin.cxx +++ b/src/input/plugins/AlsaInputPlugin.cxx @@ -100,6 +100,7 @@ public: ~AlsaInputStream() { BlockingCall(MultiSocketMonitor::GetEventLoop(), [this](){ MultiSocketMonitor::Reset(); + DeferredMonitor::Cancel(); }); snd_pcm_close(capture_handle); diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index 852326926..85ccdf8dd 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -57,6 +57,7 @@ public: ~AlsaMixerMonitor() { BlockingCall(MultiSocketMonitor::GetEventLoop(), [this](){ MultiSocketMonitor::Reset(); + DeferredMonitor::Cancel(); }); }