Closed jacksonic closed 8 years ago
Related to #430, but that wasn't the root cause.
Looks like FutureDAO's listener management causes this problem:
this.future(function(delegate) {
var listeners = this.daoListeners_;
this.daoListeners_ = [];
this.delegate = delegate;
this.daoListeners_ = listeners;
}.bind(this));
When daoListeners_ is suppressed, the delegate doesn't get its listeners hooked up. If the delegate is later moved into another proxyDAO, it assumes there's a listener to clean up. Specifically, this happens in CachingDAO when the delegate is sent to the FutureDAO, then the FutureDAO is removed and the delegate replaces the futureDAO. Re-ordering the future.set and dao swap hides the problem.
A phantom DAO unlisten is happening on builder start