Permalink
Browse files

updated DependencyInterface::register_callback to prevent multiple ca…

…llback invokation cycles
  • Loading branch information...
evaleev committed Nov 17, 2017
1 parent 340d6f3 commit 8058323fb96ba0e1bf975b156caa5a1b74289fc1
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/madness/world/dependency_interface.h
@@ -194,10 +194,13 @@ namespace madness {
#if !defined(NDEBUG)
if (print_debug && !callers_.empty())
print("DependencyInterface::register_callback: this=", this, " ndepend=", ndepend);
if (used_once)
error("DependencyInterface::register_callback() called after object already used once");
#endif
const_cast<callbackT&>(callbacks).push(callback);
if (probe()) {
cb = std::move(const_cast<callbackT&>(callbacks));
used_once = true;
}
}
do_callbacks(cb);

0 comments on commit 8058323

Please sign in to comment.