summaryrefslogtreecommitdiff
path: root/new/button_darwin.m
diff options
context:
space:
mode:
Diffstat (limited to 'new/button_darwin.m')
-rw-r--r--new/button_darwin.m9
1 files changed, 6 insertions, 3 deletions
diff --git a/new/button_darwin.m b/new/button_darwin.m
index 4173f1c..fb511f7 100644
--- a/new/button_darwin.m
+++ b/new/button_darwin.m
@@ -9,10 +9,13 @@
@implementation uiNSButton
-- (void)dealloc
+- (void)viewDidMoveToSuperview
{
- uiDarwinControlFree(self.uiC);
- [super dealloc];
+ if (uiDarwinControlFreeWhenAppropriate(self.uiC, [self superview])) {
+ [self setTarget:nil];
+ self.uiC = NULL;
+ }
+ [super viewDidMoveToSuperview];
}
- (IBAction)uiButtonClicked:(id)sender