我在android上遇到了一个奇怪的错误,我有一个页面视图,它具有加载内容视图(FILTER)的侧视图(SIDE),而不是这个过滤器视图加载另一个视图(FORM),最后一个加载一些视图(文本)
[INFO] : ADD :: TEXT
[INFO] : ADD :: TEXT
[INFO] : ADD :: FORM
[INFO] : ADD :: FILTER
[INFO] : ADD :: SIDE
当我关闭活动页面视图时,这会在子视图上调用清理功能:
$.page.cleanup = function() {
side.cleanup();
};
console.log('ADD :: SIDE');
$.side.cleanup = function() {
console.log('DESTROY :: SIDE');
filter.cleanup();
//remove listeners, and null objects
};
console.log('ADD :: FILTER');
$.filter.cleanup = function() {
console.log('DESTROY :: FILTER');
form.cleanup();
//remove listeners, and null objects
};
console.log('ADD :: FORM');
$.form.cleanup = function() {
console.log('DESTROY :: FORM');
for(var i in text) text[i].cleanup();
//remove listeners, and null objects
};
console.log('ADD :: TEXT');
$.text.cleanup = function() {
console.log('DESTROY :: TEXT');
//remove listeners, and null objects
};
但是当我在 android 中运行清理功能时,它会启动一个循环,在 iOS 上可以正常工作:
IOS:
[INFO] : CLEANUP :: SIDE
[INFO] : CLEANUP :: FILTER
[INFO] : CLEANUP :: FORM
[INFO] : CLEANUP :: TEXT
[INFO] : CLEANUP :: TEXT
安卓:
[INFO] : CLEANUP :: SIDE
[INFO] : CLEANUP :: FILTER
[INFO] : CLEANUP :: FORM
[INFO] : CLEANUP :: TEXT
[INFO] : CLEANUP :: TEXT
[INFO] : CLEANUP :: FILTER
[INFO] : CLEANUP :: FORM
[INFO] : CLEANUP :: FILTER
[INFO] : CLEANUP :: FORM
[INFO] : CLEANUP :: FILTER
[INFO] : CLEANUP :: FORM
[INFO] : CLEANUP :: FILTER
[INFO] : CLEANUP :: FORM
...
任何想法??