Hello,
I have (yes, another one) problem. This time is related to dispatching events.
NSLog(@"LevelWillStart_LINE857 %d",[self retainCount]); SPEvent *localEvent = [[SPEvent alloc] initWithType:EVENT_TYPE_LEVEL_WILL_START bubbles:NO]; NSLog(@"LevelWillStart_LINE859 %d",[self retainCount]); [self dispatchEvent:localEvent]; NSLog(@"LevelWillStart_LINE862 %d",[self retainCount]); [localEvent release]; NSLog(@"LevelWillStart_LINE865 %d",[self retainCount]);
I obtain this log
[1508:12b03] BuildLevel:LINE356 1 [1508:12b03] BuildLevel:LINE532 1 [1508:12b03] LevelWillStart_LINE857 1 [1508:12b03] LevelWillStart_LINE859 1 [1508:12b03] OnLevelWillStart_LINE210 4 [1508:12b03] LevelWillStart_LINE862 5 [1508:12b03] LevelWillStart_LINE865 4
The log line "OnLevelWilLStart_LINE210 4" is the first line called by the method launched by EVENT_TYPE_LEVEL_WILL_START event.
Why is this happening? I can't figure out where the release count is growing.
When I release the level on my gameManager class the retain count is 6!! so the level is not being deallocated and I have a memory growing problem.
What am I doing wrong?
Best regards,