diff --git a/darwin/alloc.m b/darwin/alloc.m index 2134735a..5fd42f3b 100644 --- a/darwin/alloc.m +++ b/darwin/alloc.m @@ -22,12 +22,14 @@ void initAlloc(void) void uninitAlloc(void) { - if ([allocations count] == 0) { - NSUInteger i; + NSUInteger i; - for (i = 0; i < [delegates count]; i++) - [[delegates objectAtIndex:i] release]; - [delegates release]; + // delegates might have mapTables allocated + // TODO verify they are empty + for (i = 0; i < [delegates count]; i++) + [[delegates objectAtIndex:i] release]; + [delegates release]; + if ([allocations count] == 0) { [allocations release]; return; }