Skip to content

Commit

Permalink
MythPlayer: fix possible leak.
Browse files Browse the repository at this point in the history
If SetAudioOutput was called when an audio object had already been created; the existing object wouldn't have been destroyed
  • Loading branch information
jyavenard committed Mar 22, 2011
1 parent e699820 commit 3bcecd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythtv/audioplayer.cpp
Expand Up @@ -152,7 +152,7 @@ QString AudioPlayer::ReinitAudio(void)
}
m_no_audio_out = true;
}
else if (m_no_audio_out)
else if (m_no_audio_out && m_audioOutput)
{
VERBOSE(VB_IMPORTANT, LOC + "Enabling Audio");
m_no_audio_out = false;
Expand Down Expand Up @@ -200,8 +200,9 @@ void AudioPlayer::PauseAudioUntilBuffered()

void AudioPlayer::SetAudioOutput(AudioOutput *ao)
{
// delete current audio class if any
DeleteOutput();
m_lock.lock();
RemoveVisuals();
m_audioOutput = ao;
AddVisuals();
m_lock.unlock();
Expand Down

0 comments on commit 3bcecd0

Please sign in to comment.