aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-08-17 12:09:43 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-08-17 12:09:58 -0700
commita437fb12b6948eace575a8fc773544c2e5bc80de (patch)
treee97a67b0a4041d6e4fc986e9efcbf7b2457f99ae
parent1369f83a49766b847a58d21313be82582a67b784 (diff)
Fixed memory leak in autorelease pool
-rw-r--r--src/core/basetypes/MCAutoreleasePool.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/basetypes/MCAutoreleasePool.cc b/src/core/basetypes/MCAutoreleasePool.cc
index 8c351bdf..67e58a78 100644
--- a/src/core/basetypes/MCAutoreleasePool.cc
+++ b/src/core/basetypes/MCAutoreleasePool.cc
@@ -60,13 +60,9 @@ carray * AutoreleasePool::createAutoreleasePoolStackIfNeeded()
return stack;
}
-void AutoreleasePool::destroyAutoreleasePoolStack(void *)
+void AutoreleasePool::destroyAutoreleasePoolStack(void * value)
{
- init();
- carray * stack = (carray *) pthread_getspecific(autoreleasePoolStackKey);
- if (stack == NULL)
- return;
-
+ carray * stack = (carray *) value;
if (carray_count(stack) != 0) {
MCLog("some autoreleasepool have not been released\n");
}