diff options
author | Le-Chun Wu <lcwu@google.com> | 2011-07-14 14:27:18 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-07-14 20:14:07 -0700 |
commit | 3919950de8b54d4781c09e711fd2afabab452e69 (patch) | |
tree | 44cd918bad0ecb43b0b869e72df6df6b9d4d825c /libs/utils | |
parent | c9367a80d101827c8434db35521a3aabe5292123 (diff) | |
download | frameworks_native-3919950de8b54d4781c09e711fd2afabab452e69.zip frameworks_native-3919950de8b54d4781c09e711fd2afabab452e69.tar.gz frameworks_native-3919950de8b54d4781c09e711fd2afabab452e69.tar.bz2 |
Add a call to pthread_attr_destroy to avoid potential memory leaks.
Change-Id: Ib57efc3530e9793298190cc9cab19c9af54e11a7
Diffstat (limited to 'libs/utils')
-rw-r--r-- | libs/utils/Threads.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index 50312e7..d18c0a2 100644 --- a/libs/utils/Threads.cpp +++ b/libs/utils/Threads.cpp @@ -161,6 +161,7 @@ int androidCreateRawThreadEtc(android_thread_func_t entryFunction, pthread_t thread; int result = pthread_create(&thread, &attr, (android_pthread_entry)entryFunction, userData); + pthread_attr_destroy(&attr); if (result != 0) { LOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, errno=%d)\n" "(android threadPriority=%d)", |