Created
August 3, 2013 09:16
-
-
Save nazrdogan/6145819 to your computer and use it in GitHub Desktop.
Titanium Memory Leak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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