@@ -105,11 +105,13 @@ if (!of_tlskey_set(threadSelfKey, thread)) @throw [OFInitializationFailedException exceptionWithClass: thread.class]; +#ifndef OF_OBJFW_RUNTIME thread->_pool = objc_autoreleasePoolPush(); +#endif name = thread.name; if (name != nil) of_thread_set_name( [name cStringWithEncoding: [OFLocale encoding]]); @@ -136,11 +138,15 @@ thread->_returnValue = [[thread main] retain]; } [thread handleTermination]; +#ifdef OF_OBJFW_RUNTIME + objc_autoreleasePoolPop((void *)(uintptr_t)-1); +#else objc_autoreleasePoolPop(thread->_pool); +#endif #if defined(OF_AMIGAOS) && defined(OF_HAVE_SOCKETS) if (thread.supportsSockets) of_socket_deinit(); #endif