forked from 0x2620/oxjs
call gc before focus/blur to remove elements from focus stack that are no longer around
This commit is contained in:
parent
05b4d0cf82
commit
e51c4aa847
2 changed files with 9 additions and 4 deletions
|
|
@ -3,10 +3,11 @@
|
|||
Ox.GarbageCollection = (function() {
|
||||
|
||||
var that = function() {
|
||||
collect();
|
||||
};
|
||||
collect();
|
||||
},
|
||||
timeout;
|
||||
|
||||
setInterval(collect, 60000);
|
||||
collect();
|
||||
|
||||
function collect() {
|
||||
var len = Ox.len(Ox.UI.elements);
|
||||
|
|
@ -19,6 +20,8 @@ Ox.GarbageCollection = (function() {
|
|||
delete Ox.UI.elements[id];
|
||||
}
|
||||
});
|
||||
timeout && clearTimeout(timeout);
|
||||
timeout = setTimeout(collect, 60000);
|
||||
Ox.Log('GC', len, '-->', Ox.len(Ox.UI.elements));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue