Mercurial > dwindows
comparison mac/dw.m @ 698:e19f69a78f21
Fix for pool being removed and not just drained.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 11 Mar 2011 01:49:09 +0000 |
parents | 830e1f3672b9 |
children | b79300831495 |
comparison
equal
deleted
inserted
replaced
697:830e1f3672b9 | 698:e19f69a78f21 |
---|---|
6964 /* Mac specific function to cause garbage collection */ | 6964 /* Mac specific function to cause garbage collection */ |
6965 void _dw_pool_drain(void) | 6965 void _dw_pool_drain(void) |
6966 { | 6966 { |
6967 #if !defined(GARBAGE_COLLECT) | 6967 #if !defined(GARBAGE_COLLECT) |
6968 NSAutoreleasePool *pool = pthread_getspecific(_dw_pool_key); | 6968 NSAutoreleasePool *pool = pthread_getspecific(_dw_pool_key); |
6969 NSLog(@"Pool draining %x", (int)pool); | |
6970 [pool drain]; | 6969 [pool drain]; |
6970 pool = [[NSAutoreleasePool alloc] init]; | |
6971 pthread_setspecific(_dw_pool_key, pool); | |
6971 #endif | 6972 #endif |
6972 } | 6973 } |
6973 | 6974 |
6974 /* | 6975 /* |
6975 * Setup thread independent pools. | 6976 * Setup thread independent pools. |
6987 threadfunc = (void (*)(void *))tmp[0]; | 6988 threadfunc = (void (*)(void *))tmp[0]; |
6988 | 6989 |
6989 threadfunc(tmp[1]); | 6990 threadfunc(tmp[1]); |
6990 /* Release the pool when we are done so we don't leak */ | 6991 /* Release the pool when we are done so we don't leak */ |
6991 #if !defined(GARBAGE_COLLECT) | 6992 #if !defined(GARBAGE_COLLECT) |
6993 pool = pthread_getspecific(_dw_pool_key); | |
6992 [pool release]; | 6994 [pool release]; |
6993 #endif | 6995 #endif |
6994 free(tmp); | 6996 free(tmp); |
6995 } | 6997 } |
6996 | 6998 |