Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Fixed crash on OSX when PanicSound
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed May 5, 2021
1 parent 33b26a4 commit 95263e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/grandorgue/GOrgueSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,11 @@ void GOrgueSound::CloseSound()
{
if (m_AudioOutputs[i].port)
{
m_AudioOutputs[i].port->Close();
delete m_AudioOutputs[i].port;
m_AudioOutputs[i].port = 0;
const GOrgueSoundPort* port = m_AudioOutputs[i].port;

m_AudioOutputs[i].port = NULL;
port->Close();
delete port;
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/grandorgue/GOrgueSoundRtPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ GOrgueSoundRtPort::~GOrgueSoundRtPort()
Close();
try
{
if (m_port)
delete m_port;
if (m_port) {
const RtAudio* port = m_port;

m_port = NULL;
delete port;
}
}
catch (RtAudioError &e)
{
Expand Down

0 comments on commit 95263e6

Please sign in to comment.