mirror of https://github.com/AxioDL/boo.git
Proper MIDI thread termination
This commit is contained in:
parent
0a049645d8
commit
9078a16642
|
@ -5,6 +5,7 @@
|
||||||
#include "logvisor/logvisor.hpp"
|
#include "logvisor/logvisor.hpp"
|
||||||
|
|
||||||
#include <alsa/asoundlib.h>
|
#include <alsa/asoundlib.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
namespace boo
|
namespace boo
|
||||||
{
|
{
|
||||||
|
@ -395,6 +396,7 @@ struct ALSAAudioVoiceEngine : BaseAudioVoiceEngine
|
||||||
~MIDIIn()
|
~MIDIIn()
|
||||||
{
|
{
|
||||||
m_midiRunning = false;
|
m_midiRunning = false;
|
||||||
|
pthread_kill(m_midiThread.native_handle(), SIGTERM);
|
||||||
if (m_midiThread.joinable())
|
if (m_midiThread.joinable())
|
||||||
m_midiThread.join();
|
m_midiThread.join();
|
||||||
snd_rawmidi_close(m_midi);
|
snd_rawmidi_close(m_midi);
|
||||||
|
@ -447,6 +449,7 @@ struct ALSAAudioVoiceEngine : BaseAudioVoiceEngine
|
||||||
~MIDIInOut()
|
~MIDIInOut()
|
||||||
{
|
{
|
||||||
m_midiRunning = false;
|
m_midiRunning = false;
|
||||||
|
pthread_kill(m_midiThread.native_handle(), SIGTERM);
|
||||||
if (m_midiThread.joinable())
|
if (m_midiThread.joinable())
|
||||||
m_midiThread.join();
|
m_midiThread.join();
|
||||||
snd_rawmidi_close(m_midiIn);
|
snd_rawmidi_close(m_midiIn);
|
||||||
|
|
Loading…
Reference in New Issue