{ "id": "164139", "key": "AC-4574", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2016-10-24T21:17:41.000+0000", "created": "2016-10-21T16:24:15.000+0000", "labels": [ "defect", "ios", "iphone" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-10-24T21:17:41.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When navigating from a view back to another view, if you try and remove a webview from the view you are leaving, the app freezes and then eventually crashes.\r\n\r\nTest Case:\r\n{code:java}\r\nindex.js\r\n\r\nvar button1 = Ti.UI.createButton({\r\n\theight: 50,\r\n\twidth: 100,\r\n\tbackgroundColor: '#00FF00',\r\n\tcolor: '#FFF',\r\n\ttop: 50, \r\n\ttitle: 'Get View'\r\n});\r\n\r\nvar firstView = Ti.UI.createView({\r\n\tbackgroundColor: '#CFCFCF'\r\n});\r\n\r\nvar button2 = Ti.UI.createButton({\r\n\tbackgroundColor: '#000',\r\n\tcolor: '#FFF',\r\n\theight: 50,\r\n\twidth: 100,\r\n\ttitle: 'Get WebView'\r\n});\r\n\r\nvar secondView = Ti.UI.createView();\r\n\r\nvar button3 = Ti.UI.createButton({\r\n\tbackgroundColor: '#0000FF',\r\n\tcolor: '#FFF',\r\n\theight: 50,\r\n\twidth: 100,\r\n\ttop: 60,\r\n\ttitle: 'Go Back'\r\n});\r\n\r\nbutton3.addEventListener( 'click', function( e ) {\r\n\tvar items = firstView.children;\r\n\t\r\n\tfor( var i = 0; i<=items.length; i++ ){\r\n\t\tfirstView.remove( items[ i ] );\r\n\t\titems[ i ] = null;\r\n\t}\r\n});\r\n\r\nvar webView = Ti.UI.createWebView({\r\n\theight : Titanium.UI.SIZE,\r\n\twidth : '100%',\r\n\ttop: 20,\r\n\tcontentHeight : Ti.UI.SIZE,\r\n\tbottom : 0,\r\n\tfont : Alloy.CFG.FONT_14,\r\n\tcolor : '#666',\r\n\tignoreSslError : true,\r\n\thtml: 'This is only a test. Do not be alarmed.'\r\n});\r\n\r\nsecondView.add(webView);\r\nsecondView.add(button3);\r\n\r\nbutton2.addEventListener( 'click', function( e ) {\r\n\tfirstView.add(secondView);\r\n});\r\n\r\nfirstView.add( button2 );\r\n\r\nbutton1.addEventListener( 'click', function( e ) {\r\n\t$.testView.add( firstView );\r\n});\r\n\r\n$.testView.add( button1 );\r\n\r\n$.index.open();\r\n{code}\r\n\r\nProcess to create bug:\r\n\r\n1) Click 'Get View' button\r\n2) Click 'Get WebView' button\r\n3) Click 'Go Back' button\r\n4) Now, click 'Get WebView' button again and app will freeze and then eventually crash.\r\n\r\nI cannot reproduce this issue on Android, only iOS.\r\n", "attachment": [], "flagged": false, "summary": "Removing webviews from parent views crashes app", "creator": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.12\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 8589934592\r\n Node.js\r\n Node.js Version = 5.11.1\r\n npm Version = 3.8.6\r\n Titanium CLI\r\n CLI Version = 5.0.9\r\n Titanium SDK\r\n SDK Version = 5.5.1.GA\r\n Target Platform = iphone", "comment": { "comments": [ { "id": "399589", "author": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is the same issue as AC-4560 but that was marked resolved so I entered another one with the JS being in one file.", "updateAuthor": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-21T16:25:26.000+0000", "updated": "2016-10-21T16:25:26.000+0000" }, { "id": "399714", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Your other ticket is open. Follow guide in there. You haven't provide a full sample code. Please provide a full sample code that regenerated the issue. In here the code you provided \"testView\" is not defined. Please provide the test-case in a single JS file so it can be debugged better. But there are some problems with your code as well, for example you are firing the \"open\" event manually. This is fired by the system. You are also trying to use an open event to a view, but they are only used for window instances. We can validate the issue after the single-file test-case is available, thx!. Please provide the requirements in there. Closing this as duplicate. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-10-24T21:17:23.000+0000", "updated": "2016-10-24T21:17:23.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }