summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-21 04:13:39 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-21 04:13:39 -0700
commit9599dd2f2bfcc0a9997b6d90989fd02209bd73ee (patch)
treea44ea2d598f372efcd1ce8d9582990114ae6cef5
parent1daa3bc0b0f45048ad98010cac2f1e90a813def5 (diff)
Call setDelegate:nil during _H<> = nil.
-rw-r--r--CyteKit/TableViewCell.h2
-rw-r--r--Menes/ObjectHandle.h13
2 files changed, 8 insertions, 7 deletions
diff --git a/CyteKit/TableViewCell.h b/CyteKit/TableViewCell.h
index 364a51c..32623b3 100644
--- a/CyteKit/TableViewCell.h
+++ b/CyteKit/TableViewCell.h
@@ -54,6 +54,8 @@
_transient id<CyteTableViewCellDelegate> delegate_;
}
+- (void) setDelegate:(id<CyteTableViewCellDelegate>)delegate;
+
@end
@interface CyteTableViewCell : UITableViewCell {
diff --git a/Menes/ObjectHandle.h b/Menes/ObjectHandle.h
index 188ec1a..c4f4d1a 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_<Type_, Delegate_>::Execute(value_);
- CFRelease((CFTypeRef) value_);
+ _finline void Release_(Type_ *value) {
+ if (value != nil) {
+ MenesObjectHandle_<Type_, Delegate_>::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;
}