Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15946] iOS7: Toolbar - Using Instruments to search for Toolbar proxy crashes the app and TiUIiOSToolbarProxy does not get released

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-12-10T22:40:13.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-3.2.0, regression
ReporterWilson Luu
AssigneeVishal Duggal
Created2013-12-10T21:44:16.000+0000
Updated2014-06-19T12:43:28.000+0000

Description

*Details:* Using Instruments to search for Toolbar proxy crashes the app. And, TiUIiOSToolbarProxy does not get released as well. *Note:* 1. This only affects iOS 7 2. This bug only occurs while using Instruments; launching the app by itself and pressing the button will not crash 3. *This is a regression as this does not occur on GA stack* *Steps to reproduce:* 1. Create default app with the following files: app.js:
var ToolbarSimple = require("ToolbarSimple").ToolbarSimple;
 
var win = Ti.UI.createWindow({
    backgroundColor : 'white'
});
var view;
function close() {
    win.remove(view);
    view = null;
}
 
view = (function() {
    var v = Ti.UI.createView({
        backgroundColor : 'black'
    });
    var toolbar = new ToolbarSimple("Title");
    v.add(toolbar);
    toolbar.addEventListener("done", close);
    toolbar.addEventListener("cancel", close);
    return v;
})();
 
win.add(view);
 
win.open();
ToolbarSimple.js:
exports.ToolbarSimple = function(title) {
    var toolbar;
    var cancel = Titanium.UI.createButton({
        systemButton : Ti.UI.iPhone.SystemButton.CANCEL
    });
    cancel.addEventListener('click', function() {
        toolbar.fireEvent("cancel");
    });
    var done = Titanium.UI.createButton({
        systemButton : Ti.UI.iPhone.SystemButton.DONE
    });
    done.addEventListener('click', function() {
        toolbar.fireEvent("done");
    });
 
    var spacer = Titanium.UI.createButton({
        systemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
    });
    var lbl = Ti.UI.createLabel({
        text : title,
        color : 'white',
        font : {
            fontWeight : 'bold',
            fontSize : 18
        }
    });
    toolbar = Ti.UI.iOS.createToolbar({
        height : 43,
        barColor : "purple",
        items : [cancel, spacer, lbl, spacer, done]
    });
    return toolbar;
};
2. Install app to an iOS 7 device 3. Next, open instruments; choose allocation template 4. Choose the target device and target app 5. Filter by proxy 6. On the app, press done *Actual:* App will silently crash (see attachments for console log and crash report) and TiUIiOSToolbarProxy does not get released. *Expected:* App should not silently crash while using Instruments and TiUIiOSToolbarProxy should be released.

Attachments

FileDateSize
console.log2013-12-10T21:44:16.000+0000980
LeakAgent 12-10-13, 1-13 PM.crash2013-12-10T21:44:16.000+000015574

Comments

  1. Wilson Luu 2013-12-10

    Closing ticket as invalid. Was not able to reproduce the issue with 3.2.0.v20131209192649 and 3.2.0.v20131210112451. I might've dirtied the test device with other test apps.

JSON Source