diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-08 15:53:50 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-08 15:53:50 -0400 |
| commit | bb229f9dc110fbc1293be02c71ca4b37b038081e (patch) | |
| tree | 2c02fee4340f9af429810c6e801df33ae249b270 /new/ui_darwin.h | |
| parent | 25b33c2afd8aa772002f136c2f3bd9d56e22a0ca (diff) | |
Built up a better system for handling data cleanup on Mac OS X; thanks to http://stackoverflow.com/questions/29522715/is-there-a-reliable-way-to-destroy-private-data-structures-when-a-standard-nsvie.
Diffstat (limited to 'new/ui_darwin.h')
| -rw-r--r-- | new/ui_darwin.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/new/ui_darwin.h b/new/ui_darwin.h index e898c10..f94261a 100644 --- a/new/ui_darwin.h +++ b/new/ui_darwin.h @@ -10,8 +10,9 @@ This file assumes that you have imported <Cocoa/Cocoa.h> and "ui.h" beforehand. // uiDarwinNewControl() creates a new uiControl with the given Cocoa control inside. // The first parameter should come from [RealControlType class]. // The two scrollView parameters allow placing scrollbars on the new control. -// Your control must call uiDarwinControlFree() on the returned uiControl in its -[dealloc] method. +// 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 uiControl *uiDarwinNewControl(Class class, BOOL inScrollView, BOOL scrollViewHasBorder); -extern void uiDarwinControlFree(uiControl *); +extern BOOL uiDarwinControlFreeWhenAppropriate(uiControl *c, NSView *newSuperview); #endif |
