[TIMOB-26475] Adding willclose event on window
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | ios |
Reporter | Ani Sinanaj |
Assignee | Eric Merriman |
Created | 2018-09-05T14:23:27.000+0000 |
Updated | 2018-10-20T22:31:22.000+0000 |
Description
What happened:
Index
Added a map to a secondary window
Added many annotations to the map with a custom view each
Running the app:
* From the index, I open the secondary window containing the map. I let it load some annotations, then go back.
* The app crashes
From the logs, it read that some objects were not cleaned before closing the window. Listening to the close event didn't work since it is fired after the window has closed. Added awillclose
event to do all the cleanup before actually closing the window.
Commit https://github.com/caffeinalab/titanium_mobile/commit/849717ced4f7a0b7c33439a70c7cac056b33400d
PR to come
It looks like rather Ti.Map should be improved to handle this than a new, iOS-only event. Also, the "blur" event comes pretty close to this state, which is called before the "close" event.
If I remember correctly, I tried the blur event and it didn't resolve my issue. Probably improving Ti.Map would be necessary, nevertheless I think exposing
willclose
isn't a bad idea. It may be useful.