|
From: Martin R. <ru...@us...> - 2009-03-22 18:51:42
|
Update of /cvsroot/foo/foo/libfoo/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18699/libfoo/src Modified Files: FOOContext.m FOOObjectManager.m FOOOutput.m FOOOutputManager.m FOOSoundFile.m Log Message: fixed possible memleak Index: FOOOutputManager.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOOutputManager.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FOOOutputManager.m 25 Jun 2005 13:20:56 -0000 1.5 --- FOOOutputManager.m 22 Mar 2009 18:51:31 -0000 1.6 *************** *** 67,84 **** RELEASE(_filename); } if (_buffers != nil) { - [_buffers removeAllObjects]; RELEASE(_buffers); } if (_caches != nil) { ! [_caches removeAllObjects]; ! RELEASE(_caches); } if (_outputs != nil) { ! [_outputs removeAllObjects]; ! RELEASE(_outputs); } [super dealloc]; --- 67,89 ---- RELEASE(_filename); } + if (_soundfile != nil) + { + if ([_soundfile isOpen] == YES) + { + [_soundfile close]; + } + RELEASE(_soundfile); + } if (_buffers != nil) { RELEASE(_buffers); } if (_caches != nil) { ! RELEASE(_caches); } if (_outputs != nil) { ! RELEASE(_outputs); } [super dealloc]; *************** *** 346,349 **** --- 351,373 ---- + - (FOOObjectManager *) removeAllObjects + { + if (_buffers != nil) + { + [_buffers removeAllObjects]; + } + if (_caches != nil) + { + [_caches removeAllObjects]; + } + if (_outputs != nil) + { + [_outputs removeAllObjects]; + } + + return [super removeAllObjects]; + } + + /* * archiving methods *************** *** 369,373 **** ! - (FOOOutputManager *) initWithCoder: (NSCoder *)coder { self = [super initWithCoder: coder]; --- 393,397 ---- ! - (id) initWithCoder: (NSCoder *)coder { self = [super initWithCoder: coder]; Index: FOOObjectManager.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOObjectManager.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FOOObjectManager.m 28 Feb 2005 16:37:22 -0000 1.6 --- FOOObjectManager.m 22 Mar 2009 18:51:31 -0000 1.7 *************** *** 115,118 **** --- 115,119 ---- + /* * archiving methods *************** *** 135,139 **** ! - (FOOObjectManager *) initWithCoder: (NSCoder *)coder { self = [super init]; --- 136,140 ---- ! - (id) initWithCoder: (NSCoder *)coder { self = [super init]; Index: FOOContext.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOContext.m,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FOOContext.m 25 Jun 2005 13:20:56 -0000 1.10 --- FOOContext.m 22 Mar 2009 18:51:31 -0000 1.11 *************** *** 178,187 **** - (void) dealloc { ! RELEASE([_moduleManager removeAllObjects]); ! RELEASE([_eagerModuleManager removeAllObjects]); ! RELEASE([_substrateManager removeAllObjects]); ! RELEASE([_volatileBufferManager removeAllObjects]); ! RELEASE([_sharedBufferManager removeAllObjects]); ! RELEASE([_outputManager removeAllObjects]); RELEASE(_nilModule); [super dealloc]; --- 178,187 ---- - (void) dealloc { ! RELEASE(_moduleManager); ! RELEASE(_eagerModuleManager); ! RELEASE(_substrateManager); ! RELEASE(_volatileBufferManager); ! RELEASE(_sharedBufferManager); ! RELEASE(_outputManager); RELEASE(_nilModule); [super dealloc]; *************** *** 506,510 **** ! - (FOOContext *) initWithCoder: (NSCoder *)coder { self = [super init]; --- 506,510 ---- ! - (id) initWithCoder: (NSCoder *)coder { self = [super init]; Index: FOOSoundFile.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOSoundFile.m,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FOOSoundFile.m 7 Nov 2007 20:28:13 -0000 1.10 --- FOOSoundFile.m 22 Mar 2009 18:51:31 -0000 1.11 *************** *** 95,99 **** { if ([self isOpen]) ! { [self close]; } --- 95,99 ---- { if ([self isOpen]) ! { [self close]; } *************** *** 897,901 **** ! - (FOOSoundFile *) initWithCoder: (NSCoder *)coder { self = [super initWithCoder: coder]; --- 897,901 ---- ! - (id) initWithCoder: (NSCoder *)coder { self = [super initWithCoder: coder]; Index: FOOOutput.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOOutput.m,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FOOOutput.m 28 Feb 2005 16:37:22 -0000 1.4 --- FOOOutput.m 22 Mar 2009 18:51:31 -0000 1.5 *************** *** 127,131 **** ! - (FOOOutput *) initWithCoder: (NSCoder *)coder { self = [super initWithCoder: coder]; --- 127,131 ---- ! - (id) initWithCoder: (NSCoder *)coder { self = [super initWithCoder: coder]; |