]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Added extra initialization for hlist
authorJaroslav Kysela <perex@perex.cz>
Tue, 20 Nov 2001 15:16:58 +0000 (15:16 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 20 Nov 2001 15:16:58 +0000 (15:16 +0000)
src/async.c

index a89bbfd3f39c44c3655a49b918c581ac9bf274cf..8c63464f77ba2eb159385fbc5b0dcf3cc2eed3cb 100644 (file)
@@ -89,6 +89,7 @@ int snd_async_add_handler(snd_async_handler_t **handler, int fd,
        h->private_data = private_data;
        was_empty = list_empty(&snd_async_handlers);
        list_add_tail(&h->glist, &snd_async_handlers);
+       INIT_LIST_HEAD(&h->hlist);
        *handler = h;
        if (was_empty) {
                int err;
@@ -129,7 +130,8 @@ int snd_async_del_handler(snd_async_handler_t *handler)
        }
        if (handler->type == SND_ASYNC_HANDLER_GENERIC)
                goto _end;
-       list_del(&handler->hlist);
+       if (!list_empty(&handler->hlist))
+               list_del(&handler->hlist);
        if (!list_empty(&handler->hlist))
                goto _end;
        switch (handler->type) {