diff options
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 { |
