diff --git a/Headers/Foundation/NSIndexSet.h b/Headers/Foundation/NSIndexSet.h index 9ec5187a1..4e3cbd881 100644 --- a/Headers/Foundation/NSIndexSet.h +++ b/Headers/Foundation/NSIndexSet.h @@ -99,16 +99,16 @@ extern "C" { #if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST) DEFINE_BLOCK_TYPE(GSIndexSetEnumerationBlock, void, NSUInteger, BOOL*); -- (void)enumerateIndexesInRange: (NSRange)range - options: (NSEnumerationOptions)opts - usingBlock: (GSIndexSetEnumerationBlock)aBlock; +- (void) enumerateIndexesInRange: (NSRange)range + options: (NSEnumerationOptions)opts + usingBlock: (GSIndexSetEnumerationBlock)aBlock; /** * Enumerate all indices in the set by applying a block to them. */ -- (void)enumerateIndexesUsingBlock: (GSIndexSetEnumerationBlock)aBlock; +- (void) enumerateIndexesUsingBlock: (GSIndexSetEnumerationBlock)aBlock; -- (void)enumerateIndexesWithOptions: (NSEnumerationOptions)opts - usingBlock: (GSIndexSetEnumerationBlock)aBlock; +- (void) enumerateIndexesWithOptions: (NSEnumerationOptions)opts + usingBlock: (GSIndexSetEnumerationBlock)aBlock; #endif diff --git a/Source/GSFileHandle.m b/Source/GSFileHandle.m index 5d86505d9..cc70408dd 100644 --- a/Source/GSFileHandle.m +++ b/Source/GSFileHandle.m @@ -359,11 +359,14 @@ static GSTcpTune *tune = nil; DESTROY(address); DESTROY(service); DESTROY(protocol); - - [self finalize]; - DESTROY(readInfo); DESTROY(writeInfo); + + /* Finalize *after* destroying readInfo and writeInfo so that, if the + * file handle needs to be closed, we don't generate any notifications + * containing the deallocated object. Tnanks to david for this fix. + */ + [self finalize]; [super dealloc]; }