OSDN Git Service

bluez a2dp - destroy thread attr after thread create
authorIan Kent <raven@themaw.net>
Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)
committerNick Pelly <npelly@google.com>
Wed, 30 Sep 2009 00:08:57 +0000 (17:08 -0700)
Pthread resources may be used by the thread attributes object.
We should destroy this after thread creation.

audio/liba2dp.c

index 5c4ef51..98fd8cd 100755 (executable)
@@ -1068,12 +1068,14 @@ int a2dp_init(int rate, int channels, a2dpData* dataPtr)
        pthread_cond_signal(&data->thread_wait);
 
        pthread_mutex_unlock(&data->mutex);
+       pthread_attr_destroy(&attr);
 
        *dataPtr = data;
        return 0;
 error:
        bluetooth_close(data);
        sbc_finish(&data->sbc);
+       pthread_attr_destroy(&attr);
        a2dp_free(data);
 
        return err;