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/container_darwin.m | |
| 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/container_darwin.m')
| -rw-r--r-- | new/container_darwin.m | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/new/container_darwin.m b/new/container_darwin.m index af1acee..747ccf7 100644 --- a/new/container_darwin.m +++ b/new/container_darwin.m @@ -10,10 +10,17 @@ // thanks to mikeash and JtRip in irc.freenode.net/#macdev @implementation uiContainer -uiLogObjCClassAllocations( - if (self.child != NULL) - uiControlDestroy(self.child); -) +uiLogObjCClassAllocations + +- (void)viewDidMoveToSuperview +{ + if ([self superview] == nil) + if (self.child != NULL) { + uiControlDestroy(self.child); + self.child = NULL; + } + [super viewDidMoveToSuperview]; +} - (void)setFrameSize:(NSSize)s { |
