summaryrefslogtreecommitdiff
path: root/new/newcontrol_darwin.m
diff options
context:
space:
mode:
Diffstat (limited to 'new/newcontrol_darwin.m')
-rw-r--r--new/newcontrol_darwin.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/new/newcontrol_darwin.m b/new/newcontrol_darwin.m
index 2274190..4586331 100644
--- a/new/newcontrol_darwin.m
+++ b/new/newcontrol_darwin.m
@@ -14,7 +14,7 @@ struct uiSingleViewControl {
static void singleDestroy(uiControl *c)
{
- [S(c)->view release];
+ [S(c)->view removeFromSuperview];
}
static uintptr_t singleHandle(uiControl *c)
@@ -90,7 +90,11 @@ uiControl *uiDarwinNewControl(Class class, BOOL inScrollView, BOOL scrollViewHas
return (uiControl *) c;
}
-void uiDarwinControlFree(uiControl *c)
+BOOL uiDarwinControlFreeWhenAppropriate(uiControl *c, NSView *newSuperview)
{
- uiFree(c);
+ if (newSuperview == nil) {
+ uiFree(c);
+ return YES;
+ }
+ return NO;
}