summaryrefslogtreecommitdiffstats
path: root/kmix/mixer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmix/mixer.cpp')
-rw-r--r--kmix/mixer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/kmix/mixer.cpp b/kmix/mixer.cpp
index 62b6430a..778d6af9 100644
--- a/kmix/mixer.cpp
+++ b/kmix/mixer.cpp
@@ -80,7 +80,9 @@ bool Mixer::isValid(int driver, int device)
Mixer_Backend *mb = mf(device);
if (mb)
{
- return mb->isValid();
+ bool ret = mb->isValid();
+ delete mb;
+ return ret;
}
}
return false;
@@ -92,8 +94,8 @@ Mixer::Mixer( int driver, int device ) : DCOPObject( "Mixer" )
_mixerBackend = 0;
getMixerFunc *f = g_mixerFactories[driver].getMixer;
- if( f!=0 ) {
- _mixerBackend = f( device );
+ if (f) {
+ _mixerBackend = f(device );
}
readSetFromHWforceUpdate(); // enforce an initial update on first readSetFromHW()
@@ -120,6 +122,10 @@ Mixer::~Mixer() {
// Close the mixer. This might also free memory, depending on the called backend method
close();
delete _pollingTimer;
+ if (_mixerBackend)
+ {
+ delete _mixerBackend;
+ }
}
void Mixer::volumeSave( TDEConfig *config )