Add copyWithZone: to OFBPathInfoCell

This is mainly to manually copy-construct the C++ instance counter that we use (in debug mode) to track leaks (or an erroneous extra release).

For good measure we also set the spinTimer instance variable to nil. Though this functionality isn’t presently used, so hasn’t actually caused a problem.
This commit is contained in:
Allan Odgaard
2012-12-27 00:04:32 +01:00
parent ba274c160f
commit 33e11aedb0

View File

@@ -12,6 +12,14 @@
@implementation OFBPathInfoCell
@synthesize isOpen, isVisible, labelIndex, isLoading, spinTimer, mouseDownInCloseButton;
- (id)copyWithZone:(NSZone*)aZone
{
OFBPathInfoCell* res = [super copyWithZone:aZone];
DB(new(&res->_instance_counter_helper) watch_leaks_OFBPathInfoCell(_instance_counter_helper));
res->spinTimer = nil;
return res;
}
- (void)drawLabelIndex:(NSUInteger)labelColorIndex inFrame:(NSRect)cellFrame
{
if(labelColorIndex == 0)