Skip to content

Instantly share code, notes, and snippets.

@nazrdogan
Created August 3, 2013 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazrdogan/6145819 to your computer and use it in GitHub Desktop.
Save nazrdogan/6145819 to your computer and use it in GitHub Desktop.
Titanium Memory Leak
var button = Ti.UI.createButton({
// parameters go here...
});
var view = Ti.UI.createView({
// some parameters here...
});
view.add(button);
// ... later
win.remove(view); // view & button still exist
view = null; // deletes the view and its proxy, but not the button!
// compare that to:
var view = Ti.UI.createView({
// some parameters here...
});
view.add(Ti.UI.createButton({
// parameters go here...
}));
// ... later
win.remove(view);
view = null; // deletes the view, button, and their proxies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment