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;
};
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.