diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-08-22 17:28:46 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-08-28 17:50:40 +0900 |
commit | 0abea4fb1f6946d5025a504c9996329a305410ce (patch) | |
tree | 6639edd078d10a63fa0c00a247e54cf61a53e7fe | |
parent | 337b217e9969813c0d6da8a7edd7847972e38927 (diff) | |
download | tdemultimedia-0abea4fb1f6946d5025a504c9996329a305410ce.tar.gz tdemultimedia-0abea4fb1f6946d5025a504c9996329a305410ce.zip |
Free up alsa device iterator resources correctly.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | kmix/mixer_alsa.h | 1 | ||||
-rw-r--r-- | kmix/mixer_alsa9.cpp | 16 |
2 files changed, 11 insertions, 6 deletions
diff --git a/kmix/mixer_alsa.h b/kmix/mixer_alsa.h index cb759e3f..e186eb93 100644 --- a/kmix/mixer_alsa.h +++ b/kmix/mixer_alsa.h @@ -54,6 +54,7 @@ class ALSA_DevIterator : public DevIterator { public: ALSA_DevIterator(); + ~ALSA_DevIterator(); virtual void next(); }; diff --git a/kmix/mixer_alsa9.cpp b/kmix/mixer_alsa9.cpp index 22303b43..54af7161 100644 --- a/kmix/mixer_alsa9.cpp +++ b/kmix/mixer_alsa9.cpp @@ -833,16 +833,20 @@ ALSA_DevIterator::ALSA_DevIterator() NMax = 31; } +ALSA_DevIterator::~ALSA_DevIterator() +{ + snd_config_update_free_global(); +} + void ALSA_DevIterator::next() { -#if 0 - int rc = snd_card_next(&N); - if (rc || (N == -1)) N = NMax + 1; -#else - if ((snd_card_next(&N) != 0) || (N == -1)) N = NMax + 1; -#endif + if ((snd_card_next(&N) != 0) || (N == -1)) + { + N = NMax + 1; + } } + DevIterator* ALSA_getDevIterator() { return new ALSA_DevIterator(); |