From 55191e34aebf9db287e477675325f41b2ef818c3 Mon Sep 17 00:00:00 2001 From: theraven Date: Thu, 30 Jun 2011 12:56:59 +0000 Subject: [PATCH] Fix the fast path. It should fall back to doing what the slow path does if the other half is not using it. --- arc.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arc.m b/arc.m index 0437abd..0006a05 100644 --- a/arc.m +++ b/arc.m @@ -71,8 +71,12 @@ id objc_retainAutoreleasedReturnValue(id obj) return objc_retain(obj); #else id old = pthread_getspecific(ReturnRetained); - pthread_setspecific(ReturnRetained, NULL); - return old; + if (obj != old) + { + objc_autorelease(old); + objc_retain(obj); + } + return obj; #endif }