Mercurial > dwindows
changeset 2640:cee87daaf150
iOS: New method of removing DWWindow from the hierarchy.
The [window release] is causing instability afterward, removing the release
makes it appear to function correctly, but might be leaking memory.
Adding a TODO to look into this more later, once everything is functional.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 13 Aug 2021 19:55:40 +0000 |
parents | 0be4b2e21885 |
children | 608598b9fed9 |
files | ios/dw.m |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ios/dw.m Thu Aug 12 22:22:12 2021 +0000 +++ b/ios/dw.m Fri Aug 13 19:55:40 2021 +0000 @@ -8540,10 +8540,14 @@ if([object isKindOfClass:[UIWindow class]]) { DWWindow *window = handle; + [window setHidden:YES]; [_dw_toplevel_windows removeObject:window]; - [window setHidden:YES]; - [window removeFromSuperview]; - [window release]; + [[[window rootViewController] view] removeFromSuperview]; + [window setRootViewController:nil]; + /* Releasing the window is causing crashes.... + * TODO: Figure out if this is needed... or why it is crashing. + * [window release]; + */ } /* Handle removing menu items from menus */ else if([object isMemberOfClass:[DWMenuItem class]])