mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
use atFlush in UI test helpers
This commit is contained in:
@@ -50,11 +50,9 @@ OnscreenDiv.prototype.kill = function() {
|
||||
if (self.div.parentNode)
|
||||
self.div.parentNode.removeChild(self.div);
|
||||
|
||||
var cx = new Meteor.deps.Context;
|
||||
cx.on_invalidate(function() {
|
||||
Meteor.atFlush(function () {
|
||||
Spark.finalize(self.div);
|
||||
});
|
||||
cx.invalidate();
|
||||
};
|
||||
|
||||
// remove the DIV from the document
|
||||
|
||||
@@ -31,13 +31,11 @@ WrappedFrag.prototype.release = function() {
|
||||
// decrement frag's GC protection reference count
|
||||
// Clean up on flush, if hits 0. Wait to decrement
|
||||
// so no one else cleans it up first.
|
||||
var cx = new Meteor.deps.Context;
|
||||
cx.on_invalidate(function() {
|
||||
Meteor.atFlush(function () {
|
||||
if (! --frag["_protect"]) {
|
||||
Spark.finalize(frag);
|
||||
}
|
||||
});
|
||||
cx.invalidate();
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user