From 9599dd2f2bfcc0a9997b6d90989fd02209bd73ee Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 21 Mar 2011 04:13:39 -0700 Subject: [PATCH] Call setDelegate:nil during _H<> = nil. --- CyteKit/TableViewCell.h | 2 ++ Menes/ObjectHandle.h | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CyteKit/TableViewCell.h b/CyteKit/TableViewCell.h index 364a51cc..32623b30 100644 --- a/CyteKit/TableViewCell.h +++ b/CyteKit/TableViewCell.h @@ -54,6 +54,8 @@ _transient id delegate_; } +- (void) setDelegate:(id)delegate; + @end @interface CyteTableViewCell : UITableViewCell { diff --git a/Menes/ObjectHandle.h b/Menes/ObjectHandle.h index 188ec1ae..c4f4d1a7 100644 --- a/Menes/ObjectHandle.h +++ b/Menes/ObjectHandle.h @@ -79,10 +79,10 @@ class MenesObjectHandle { CFRetain((CFTypeRef) value_); } - _finline void Clear_() { - if (value_ != nil) { - MenesObjectHandle_::Execute(value_); - CFRelease((CFTypeRef) value_); + _finline void Release_(Type_ *value) { + if (value != nil) { + MenesObjectHandle_::Execute(value); + CFRelease((CFTypeRef) value); } } @@ -100,7 +100,7 @@ class MenesObjectHandle { } _finline ~MenesObjectHandle() { - Clear_(); + Release_(value_); } _finline operator Type_ *() const { @@ -112,8 +112,7 @@ class MenesObjectHandle { Type_ *old(value_); value_ = value; Retain_(); - if (old != nil) - CFRelease((CFTypeRef) old); + Release_(old); } return *this; } -- 2.45.2