{ "id": "164014", "key": "TIMOB-24096", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2016-11-04T14:09:52.000+0000", "created": "2016-10-17T19:03:40.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "defect", "ios", "iphone" ], "versions": [ { "id": "18322", "name": "Release 5.5.1", "archived": false, "released": true, "releaseDate": "2016-09-28" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-24T18:57:01.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "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 testView = Ti.UI.createView({\r\n\tlayout: 'vertical',\r\n\tbackgroundColor: '#FFF'\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\ttestView.add( firstView );\r\n});\r\ntestView.add( button1 );\r\n\r\n$.index.add( testView );\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 View' 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": [ { "id": "60627", "filename": "index.js", "author": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-31T18:10:17.000+0000", "size": 1364, "mimeType": "text/javascript" }, { "id": "60626", "filename": "index.xml", "author": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-31T18:10:17.000+0000", "size": 46, "mimeType": "text/xml" } ], "flagged": false, "summary": "iOS: 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", "closedSprints": [ { "id": 752, "state": "closed", "name": "2016 Sprint 23 SDK", "startDate": "2016-11-05T00:39:37.027Z", "endDate": "2016-11-19T01:39:00.000Z", "completeDate": "2016-11-29T06:51:57.887Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "399136", "author": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried making this a ticket under TIMOB but I couldn't figure out how. Sorry, this is my first time reporting a bug :)", "updateAuthor": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-17T19:04:52.000+0000", "updated": "2016-10-17T19:04:52.000+0000" }, { "id": "399204", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "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!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-18T08:19:54.000+0000", "updated": "2016-10-18T09:32:56.000+0000" }, { "id": "399528", "author": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Hans Knoechel,\r\n\r\nI have put all the code into one JS file so you should be able to debug it now. I understand that navigating through views is the wrong approach but this is the way the app was built back when we started using Titanium on 3.1.4, and it just now stopped working on 5.5.1.GA. Let me know what you find out.", "updateAuthor": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-20T21:18:57.000+0000", "updated": "2016-10-20T21:18:57.000+0000" }, { "id": "399715", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, You haven't provide a full sample code. Please provide a full sample code that regenerated the issue. For example, In here the code you provided \"testView\" is not defined. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-10-24T21:19:48.000+0000", "updated": "2016-10-24T21:19:48.000+0000" }, { "id": "399717", "author": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have updated the sample code. It should work correctly now. Thank you!", "updateAuthor": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-24T21:33:39.000+0000", "updated": "2016-10-24T21:33:39.000+0000" }, { "id": "400048", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Send the full code index.xml, index.js. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-10-28T19:04:33.000+0000", "updated": "2016-10-28T19:04:33.000+0000" }, { "id": "400120", "author": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have attached the requested index.js and index.xml files", "updateAuthor": { "name": "Uhlig", "key": "uhlig", "displayName": "Uhlig Mobile", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-31T18:10:33.000+0000", "updated": "2016-10-31T18:10:33.000+0000" }, { "id": "400358", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I can reproduce the issue with your sample code. For me the app hangs when removing webview. The issue is reproducible with SDK 5.5.1.GA. \r\n\r\nperating System\r\n Name = Mac OS X\r\n Version = 10.11.6\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 4.2.2\r\n npm Version = 2.14.7\r\nTitanium CLI\r\n CLI Version = 5.0.9\r\nTitanium SDK\r\n SDK Version = 5.5.1.GA\r\n Target Platform = iphone\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-11-03T19:11:19.000+0000", "updated": "2016-11-03T19:11:19.000+0000" }, { "id": "400400", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I am able to reproduce your test-case, but:\r\n- You use a lot of incorrect properties that are not even supported by the webview or have no effect, e.g. {{contentHeight}} and {{height : Titanium.UI.SIZE}} (webviews always fill)\r\n- The crash is caused by manually nulling the children ({{items[ i ] = null;}} by causing an infinite loop; the children are deallocated automatically when calling {{remove}}\r\n- Use {{Ti.UI.FILL}} instead of {{100 %}} for a generally improved performance\r\n- You should always remove views directly, and not use the {{children[i]}} property. This is recommended because removing single children will also update the internal index structure of the children everytime you call it. By looping through them, you will have null-values that will be catched by the core, but an error {{Invalid type passed to function. expected: TiViewProxy, was: NSNull -[TiViewProxy remove:] (TiViewProxy.m:330)}} will be called as a consequence\r\n\r\nAs a result, I will resolve this issue as {{Not our Bug}} for now. Follow the above improvements and the app will work again, thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-04T14:09:45.000+0000", "updated": "2016-11-04T14:09:45.000+0000" }, { "id": "415714", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket with reference to the previous comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:57:01.000+0000", "updated": "2017-03-24T18:57:01.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }