All of lore.kernel.org
 help / color / mirror / Atom feed
* Memleak with mixer? Or incorrect code?
@ 2005-01-12 11:23 Reimar Döffinger
  2005-01-13 17:07 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Reimar Döffinger @ 2005-01-12 11:23 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

Hi,
the attached code consumes more and more memory when I run it (with alsa
1.0.3 as included in SuSE 9.1).
Why is that so? Did I forget to free something?
Both commenting out the snd_mixer_selem_register or the snd_mixer_load
call will fix it, but that's not an option in real code (this is
actually a stripped-down version of the code in MPlayer's ao_alsa.c)...
Any hints on that??

Greetings,
Reimar Döffinger

[-- Attachment #2: alsa.c --]
[-- Type: text/plain, Size: 439 bytes --]

#include <alsa/asoundlib.h>

int main() {
  snd_mixer_t *handle; 
  snd_mixer_selem_id_t *sid;
  snd_mixer_class_t *class;
  int err;
  while (1) {
    snd_mixer_open(&handle, 0);
    snd_mixer_attach(handle, "default");
    snd_mixer_selem_register(handle, NULL, NULL);
    snd_mixer_load(handle);
    snd_mixer_free(handle);
    snd_mixer_detach(handle, "default");
    snd_mixer_close(handle);
//    sleep(100);
  }
}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-18 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-12 11:23 Memleak with mixer? Or incorrect code? Reimar Döffinger
2005-01-13 17:07 ` Takashi Iwai
2005-01-18 20:15   ` Reimar Döffinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.