Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2357] iOS: ti.map module crashes application when closing window

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-09-29T13:12:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.3.0
ComponentsMap
Labelsconsider-6.2.3
ReporterJoshua A. Ceaser
AssigneeHans Knöchel
Created2017-09-07T14:09:49.000+0000
Updated2018-08-06T17:49:22.000+0000

Description

When opening a map view closing the window with the map view can cause crashes. This was introduced in 2.9 version of ti.map. I have tested version 2.8 of ti.map and have been unable to recreate the issue. I believe it is in one of the following commits: https://github.com/appcelerator-modules/ti.map/commit/2eacf35689d0ef974f53571ecfb6036b5d249dc9#diff-9e304d4e8df1b74cfa009913198428ab https://github.com/appcelerator-modules/ti.map/commit/428abe60efba08b316280fcc029ef9fd93d35be7#diff-9e304d4e8df1b74cfa009913198428ab Steps to reproduce: * Create a window with a button, on button click open a window in a navigation flow with a map * Populate the map with pins * Select pins and deselect them by clicking on map * Navigate back closing the window * If no crash occurs, repeat a few times.

Attachments

FileDateSize
WAPlanfinder_2017-09-06-100946_USD11JCEASERMB1.crash2017-09-07T14:03:02.000+0000105474

Comments

  1. Hans Knöchel 2017-09-07

    Hey there, the issue looks valid! Can you provide a test-case so we can speed-up the fix? I feel that the first link ([this line](https://github.com/appcelerator-modules/ti.map/commit/2eacf35689d0ef974f53571ecfb6036b5d249dc9#diff-20426eee9101f1525a7d167e3f5ae8e3R37)) is the issue, because it was released already and then crashes. We will provide a fix tomorrow or early next week, thanks for reporting this!
  2. Joshua A. Ceaser 2017-09-07

    Do you want me to create a sample project?
  3. Hans Knöchel 2017-09-08

    The one I created (navigation-window, having a window with a map, opening a window with a map, closing it again) does actually not reproduce it:
       var MapModule = require('ti.map');
       
       var win = Ti.UI.createWindow({
         backgroundColor: "white",
         title: 'Window 1'
       });
       
       var btn = Ti.UI.createButton({
         title: 'Trigger'
       });
       
       win.add(btn);
       
       var nav = Ti.UI.iOS.createNavigationWindow({
         window: win
       });
       
       btn.addEventListener('click', function() {
         var win2 = Ti.UI.createWindow({
           title: 'Window 2'
         });
         
         var pin1 = MapModule.createAnnotation({  
           latitude: 37.390749,
           longitude: -122.081651,
           title: "Title1 ",
           subtitle: 'Mountain View, CA',
           pincolor: MapModule.ANNOTATION_RED,
         }); 
          
         var mapview = MapModule.createView({  
           region: {
             latitude: 37.390749,
             longitude: -122.081651,
           },
           annotations: [pin1]
         }); 
       
         win2.add(mapview);
         nav.openWindow(win2);
       })
       
       nav.open();
       
    So an additional one would be awesome. Can you also confirm that this happens with the latest one (2.12.1) as well? We're getting there, thank you! *EDIT*: I am now able to reproduce it and working on it!
  4. Joshua A. Ceaser 2017-09-08

    Great, thank you!
  5. Hans Knöchel 2017-09-08

    PR: https://github.com/appcelerator-modules/ti.map/pull/211 Test-case: See above! I also fixed some other small issues and attached a packaged version of the module to the PR.
  6. Joshua A. Ceaser 2017-09-08

    Is this module production ready?
  7. Hans Knöchel 2017-09-08

    I still see a low frequence of crashes, even with the latest fix, so I need to dive in a bit more into this. More on Monday then. *EDIT*: Fixed those as well - I basically moved to whole project to ARC to fix all possible issues related to memory-counting / releasing. Please try [this version](https://github.com/appcelerator-modules/ti.map/files/1288963/ti.map-iphone-2.12.2.zip). It will be code-reviewed and tested by the staff next and be included in the SDK 7.0.0. But you can use it already or download it from Github as the release-page will also be updated once the review is done. Thanks again for reporting!
  8. Hans Knöchel 2017-09-12

    [~jceaser] Ping!
  9. Joshua A. Ceaser 2017-09-18

    This looks to be working with no issues. Thanks!
  10. Hans Knöchel 2017-09-28

    [~jceaser] Are you still running good with this fix? Then we may consider taking it before 7.0.0 already!
  11. Joshua A. Ceaser 2017-09-28

    I believe so I haven't seen any issues.
  12. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source