I am debugging some code. Execution has arrived to this method:
void EventNotifier::notify_observers(SpEventInfo pEvent, Observable* target)
{
std::list<Observer*>::iterator it;
for (it = m_observers.begin(); it != m_observers.end(); ++it)
{
Observable* observedTarget = (*it)->target();
bool fNotify = (observedTarget == target);
...
The last sentence of previous excerpt has been executed. Both variables, observedTarget and target, have the same value but boolean fNotify is false! Involved 'target' objects are using multiple inheritance and 'Observable' is one of the parents. But everything is casted to Observable, so the comparison should be just pointers of same type. In fact, the debugger shows the same value for both pointers.
I have no idea of were is the problem. Any help is greately appreciated. Thank you
Cecilio Salmeron
dynamic_cast.Observableobjects themselves?