New issue 35 by mi...@monscheuer.de: PSMTabBarControl -dealloc crash
http://code.google.com/p/maccode/issues/detail?id=35
It is not allowed to modify an array while being enumerated.
This is why -dealloc causes crashes with cells left in the _cells array.
Please change -dealloc to:
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
//stop any animations that may be running
[_animationTimer invalidate];
[_animationTimer release]; _animationTimer = nil;
[_showHideAnimationTimer invalidate];
[_showHideAnimationTimer release]; _showHideAnimationTimer = nil;
//Also unwind the spring, if it's wound.
[_springTimer invalidate];
[_springTimer release]; _springTimer = nil;
//unbind all the items to prevent crashing
//not sure if this is necessary or not
NSArray *cells = [NSArray arrayWithArray:_cells]; // create a copy as we
will change the original array while being enumerated
NSEnumerator *enumerator = [cells objectEnumerator];
PSMTabBarCell *nextCell;
while ( (nextCell = [enumerator nextObject]) ) {
[self removeTabForCell:nextCell];
}
[_overflowPopUpButton release];
[_cells release];
[_controller release];
[tabView release];
[_addTabButton release];
[partnerView release];
[_lastMouseDownEvent release];
[style release];
[self unregisterDraggedTypes];
[super dealloc];
}
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings