diff options
Diffstat (limited to 'new/newcontrol_darwin.m')
| -rw-r--r-- | new/newcontrol_darwin.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/new/newcontrol_darwin.m b/new/newcontrol_darwin.m index 9b9dd7b..5a346f1 100644 --- a/new/newcontrol_darwin.m +++ b/new/newcontrol_darwin.m @@ -13,6 +13,11 @@ struct uiSingleViewControl { #define S(c) ((uiSingleViewControl *) (c)) +static void singleDestroy(uiControl *c) +{ + [S(c)->view release]; +} + static uintptr_t singleHandle(uiControl *c) { return (uintptr_t) (S(c)->view); @@ -59,6 +64,7 @@ static void singleResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width, i uiControl *uiDarwinNewControl(Class class, BOOL inScrollView, BOOL scrollViewHasBorder, void *data) { uiSingleViewControl *c; + uiFreeOnDealloc *freer; c = uiNew(uiSingleViewControl); // thanks to autoxr and arwyn in irc.freenode.net/#macdev @@ -79,6 +85,7 @@ uiControl *uiDarwinNewControl(Class class, BOOL inScrollView, BOOL scrollViewHas c->immediate = (NSView *) (c->scrollView); } + c->control.destroy = singleDestroy; c->control.handle = singleHandle; c->control.setParent = singleSetParent; c->control.preferredSize = singlePreferredSize; @@ -86,6 +93,9 @@ uiControl *uiDarwinNewControl(Class class, BOOL inScrollView, BOOL scrollViewHas c->data = data; + freer = (uiFreeOnDealloc *) (c->view); + [freer uiFreeOnDealloc:c]; + return (uiControl *) c; } |
