diff --git a/AppKit/CPButtonBar.j b/AppKit/CPButtonBar.j index f271aa34e..f655796b5 100644 --- a/AppKit/CPButtonBar.j +++ b/AppKit/CPButtonBar.j @@ -218,8 +218,14 @@ count = [buttonsNotHidden count]; while (count--) - if ([buttonsNotHidden[count] isHidden]) - [buttonsNotHidden removeObject:buttonsNotHidden[count]]; + { + var button = buttonsNotHidden[count]; + + [button removeFromSuperview]; + + if ([button isHidden]) + [buttonsNotHidden removeObject:button]; + } var currentButtonOffset = _resizeControlIsLeftAligned ? CGRectGetMaxX([self bounds]) + 1 : -1, bounds = [self bounds],