[TIMOB-8063] Android: Backing out of a window with its own activity while it's still opening leads to bad state.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-03-17T19:25:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Josh Roesslein |
Assignee | Josh Roesslein |
Created | 2012-03-16T13:44:42.000+0000 |
Updated | 2017-03-27T18:23:39.000+0000 |
Description
Windows which have their own activity and take a long time to open can crash
the application if the user "backs" out of the new activity before the
window has finished opening. This is mostly seen on emulator which runs into the global
reference count limit due to a large number of Phantom references which build up.
Test case: Opening a window with a high number of child views.
This test case is taken from TIMOB-7897 and demonstrates the issue nicely. Run the application in the emulator. Click the button to load a new window with a large number of views. Notice the new activity becomes active (black screen). Hit the back button before the window finishes opening. Repeat this process until you crash the application due to the global reference limit being reached.
function mainViews() {
var newWin = Ti.UI.createWindow({ navBarHidden: true });
Ti.API.info('****** mainViews function has started ******');
var views =[];
var view = null;
for (var i=0; i < 500; i++) {
view = Ti.UI.createView();
views.push(view);
newWin.add(view);
}
newWin.open();
alert("You may click back now.");
Ti.API.info('Titanium views created and added to array');
Ti.API.info('****** mainViews function has stopped ******');
}
var win = Ti.UI.createWindow({
backgroundColor: "white"
});
var button = Ti.UI.createButton({
title: "create 5k views"
});
button.addEventListener("click", function(e) {
mainViews();
Ti.API.info('Available memory: ' + Ti.Platform.availableMemory);
});
win.add(button);
win.open();
Not seeing this issue anymore with latest master and updated test case (views reduced to 500).
Closing ticket as I am unable to reproduce this issue with the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80