summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorb-mythtv@largestprime.net <b-mythtv@largestprime.net>2011-02-27 03:50:31 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2011-02-27 03:50:31 (GMT)
commit0a8ad2cc0978b8e4c71c15806063a413028b750b (patch)
treeb85d92fcc814be62ec150d83564cff90512c496a
parent649fa85cb41f128606038a9789693657a11cd178 (diff)
Fix memory leaks in pulseaudio code.
Closes #9548 Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
-rw-r--r--mythtv/libs/libmyth/audio/audiooutputpulse.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/mythtv/libs/libmyth/audio/audiooutputpulse.cpp b/mythtv/libs/libmyth/audio/audiooutputpulse.cpp
index a7d2b90..20bf818 100644
--- a/mythtv/libs/libmyth/audio/audiooutputpulse.cpp
+++ b/mythtv/libs/libmyth/audio/audiooutputpulse.cpp
@@ -45,6 +45,11 @@ AudioOutputPulseAudio::AudioOutputPulseAudio(const AudioSettings &settings) :
AudioOutputPulseAudio::~AudioOutputPulseAudio()
{
KillAudio();
+ if (pcontext)
+ {
+ pa_context_unref(pcontext);
+ pcontext = NULL;
+ }
}
AudioOutputSettings* AudioOutputPulseAudio::GetOutputSettings()
@@ -106,6 +111,7 @@ AudioOutputSettings* AudioOutputPulseAudio::GetOutputSettings()
}
pa_context_disconnect(pcontext);
+ pa_context_unref(pcontext);
pcontext = NULL;
pa_threaded_mainloop_stop(mainloop);
mainloop = NULL;
@@ -210,6 +216,7 @@ void AudioOutputPulseAudio::CloseDevice()
{
pa_context_drain(pcontext, NULL, NULL);
pa_context_disconnect(pcontext);
+ pa_context_unref(pcontext);
pcontext = NULL;
}