libspark/audio_mixer: don't try to free() stack-allocated snd_mixer_selem_id

This commit is contained in:
martii
2013-08-14 20:48:09 +02:00
parent 75e5268a3c
commit 86e70db211
2 changed files with 1 additions and 4 deletions

View File

@@ -20,7 +20,7 @@
#include <audio_mixer.h> #include <audio_mixer.h>
mixerVolume::mixerVolume(const char *name, const char *card, long volume) { mixerVolume::mixerVolume(const char *name, const char *card, long volume) {
sid = NULL; snd_mixer_selem_id_t *sid = NULL;
elem = NULL; elem = NULL;
handle = NULL; handle = NULL;
min = 0; min = 0;
@@ -58,8 +58,6 @@ mixerVolume::~mixerVolume()
{ {
if (handle) if (handle)
snd_mixer_close(handle); snd_mixer_close(handle);
if (sid)
snd_mixer_selem_id_free(sid);
} }
bool mixerVolume::setVolume(long volume) { bool mixerVolume::setVolume(long volume) {

View File

@@ -27,7 +27,6 @@ class mixerVolume
long min, max; long min, max;
snd_mixer_t *handle; snd_mixer_t *handle;
snd_mixer_elem_t* elem; snd_mixer_elem_t* elem;
snd_mixer_selem_id_t *sid;
public: public:
mixerVolume(const char *selem_name, const char *Card, long volume = -1); mixerVolume(const char *selem_name, const char *Card, long volume = -1);
~mixerVolume(void); ~mixerVolume(void);