|
From: Martin R. <ru...@us...> - 2004-08-17 06:49:43
|
Update of /cvsroot/foo/foo/libfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20782/libfoo/src Modified Files: FOOContext.m FOOGlobalsManager.m Log Message: moved NSAutoreleasePool creation to FOOGlobalsManager.m (from fooinit.m). call recycling function when context is created or unarchived Index: FOOGlobalsManager.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOGlobalsManager.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FOOGlobalsManager.m 14 Aug 2004 06:12:34 -0000 1.5 --- FOOGlobalsManager.m 17 Aug 2004 06:47:13 -0000 1.6 *************** *** 45,48 **** --- 45,49 ---- #import <Foundation/NSValue.h> #import <Foundation/NSDictionary.h> + #import <Foundation/NSAutoreleasePool.h> #include "FOO/FOOGlobalsManager.h" *************** *** 53,56 **** --- 54,58 ---- + static NSAutoreleasePool *_pool = nil; static int _trace = NO; static FOOSineTable *_sineTable = nil; *************** *** 70,73 **** --- 72,76 ---- if (self == [FOOGlobalsManager class]) { + [self recycleAutoreleasePool]; _sineXoXHT = [NSMutableDictionary dictionary]; _fileHT = [NSMutableDictionary dictionary]; *************** *** 199,201 **** --- 202,215 ---- } + + + (void) recycleAutoreleasePool + { + if (_pool != nil) + { + RELEASE(_pool); + } + + _pool = [[NSAutoreleasePool alloc] init]; + } + @end Index: FOOContext.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOContext.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FOOContext.m 15 Aug 2004 20:30:16 -0000 1.6 --- FOOContext.m 17 Aug 2004 06:47:13 -0000 1.7 *************** *** 111,114 **** --- 111,117 ---- RELEASE(unarchiver); + // by the way + [FOOGlobalsManager recycleAutoreleasePool]; + return self; } *************** *** 158,162 **** { NSZone *zone = [self zone]; ! [super init]; _numberOfChannels = n; --- 161,165 ---- { NSZone *zone = [self zone]; ! [super init]; _numberOfChannels = n; *************** *** 171,174 **** --- 174,180 ---- _locked = NO; + // by the way + [FOOGlobalsManager recycleAutoreleasePool]; + return self; } |