|
From: Luca B. <luc...@gm...> - 2012-02-05 20:27:00
|
I noticed that the current implementation of LazyObjects generates
infinite recursions
in the case the dependency hierarchy among Observer/Observable objects
contains loops.
A suggestion to break the infinite recursion is to replace the update()
method as follows:
void LazyObject::update() {
if (!frozen_&& calculated_){
//
// Set calculated_=false before calling notifyObservers()
//
calculated_ = false;
notifyObservers();
}
calculated_ = false;
}
Luca
|