Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7403] iOS: Toolbar Proxy does not get release using require

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-14T14:00:36.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsiOS
Labelsmodule_toolbar, qe-testadded
ReporterEduardo Gomez
AssigneeMax Stepanov
Created2012-01-25T14:20:41.000+0000
Updated2013-12-10T21:45:07.000+0000

Description

Issue

Toolbar Proxy does not get release using require.

Steps to reproduce

1) Open instruments 2) Filter "proxy" objects 3) Click any Toolbar's button

Repro sequence

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();
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;
};

Comments

  1. Wilson Luu 2012-03-15

    Closing bug. Verified fix on: SDK build: 2.0.0.v20120315123246 Titanium Studio, build: 2.0.0.201203142055 xcode: 4.2 Device: iphone 4s (5.0.1) Note to QE: It takes a while for the TiUIToolbarProxy object to get released.

JSON Source