Memory Leak in Titanium tabbed iPhone application

℡╲_俬逩灬. 提交于 2019-12-06 07:15:26

You can have a look at my Gist. By using this you can solve out the memory issue to great extend. Just include the class in your project and use it like this.

https://gist.github.com/3898340

var mem = new MemoryClean();
    mem.clean(tableView);
    mem.clean(headerView);
    mem.clean(footerView);
    mem = null;

Here is what i have been using.

function openAppointments(e) {
    var mem = new MemoryClean();
    mem.clean(headerView);
    mem.clean(footerView);
    mem = null;
    win.close();
}

In the end, I solved it. It was this:

var answView = Ti.UI.createTableView({
    (...)
    _parent: qview
});

referencing the view in the answer table kept it, and all its children, from being released. Once I removed that, they get released simply by closing the window. Hope that's useful for someone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!