From 33e11aedb012223b219ea9bc51788c2c1919e4c1 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 27 Dec 2012 00:04:32 +0100 Subject: [PATCH] Add copyWithZone: to OFBPathInfoCell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Frameworks/OakFileBrowser/src/ui/OFBPathInfoCell.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Frameworks/OakFileBrowser/src/ui/OFBPathInfoCell.mm b/Frameworks/OakFileBrowser/src/ui/OFBPathInfoCell.mm index cd933385..ba586dd7 100644 --- a/Frameworks/OakFileBrowser/src/ui/OFBPathInfoCell.mm +++ b/Frameworks/OakFileBrowser/src/ui/OFBPathInfoCell.mm @@ -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)