diff --git a/darwin/newcontrol.m b/darwin/newcontrol.m index 60758fa6..bb08322f 100644 --- a/darwin/newcontrol.m +++ b/darwin/newcontrol.m @@ -230,15 +230,3 @@ void uiDarwinNewControl(uiControl *c, Class class, BOOL inScrollView, BOOL scrol c->ContainerEnable = singleContainerEnable; c->ContainerDisable = singleContainerDisable; } - -BOOL uiDarwinControlFreeWhenAppropriate(uiControl *c, NSView *newSuperview) -{ - singleView *s = (singleView *) (c->Internal); - - if (newSuperview == destroyedControlsView) { - [s->immediate release]; // we don't need the reference anymore - uiFree(s); - return YES; - } - return NO; -} diff --git a/ui_darwin.h b/ui_darwin.h index 097b5de4..cd0b14cb 100644 --- a/ui_darwin.h +++ b/ui_darwin.h @@ -11,10 +11,7 @@ This file assumes that you have imported and "ui.h" beforehand. // The second parameter should come from [RealControlType class]. // The two scrollView parameters allow placing scrollbars on the new control. // The two onDestroy parameters define a function and its parameter to call when the widget is destroyed. -// Your control must call uiDarwinControlFreeWhenAppropriate() on the returned uiControl in its -[viewDidMoveToSuperview] method. -// If it returns a value other than NO, then the uiControl has been freed and you should set references to it to NULL. extern void uiDarwinNewControl(uiControl *c, Class class, BOOL inScrollView, BOOL scrollViewHasBorder, void (*onDestroy)(void *), void *onDestroyData); -extern BOOL uiDarwinControlFreeWhenAppropriate(uiControl *c, NSView *newSuperview); // You can use this function from within your control implementations to return text strings that can be freed with uiTextFree(). extern char *uiDarwinNSStringToText(NSString *);