use atFlush in UI test helpers

This commit is contained in:
David Greenspan
2012-09-16 04:37:20 -07:00
parent bb9f1fe94a
commit d8de162bbc
2 changed files with 2 additions and 6 deletions

View File

@@ -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

View File

@@ -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;
};