Commit 1544246 from Alan Conway in branch 'qpid/branches/0.26'
[ https://svn.apache.org/r1544246 ]
QPID-5366: qpid segfaults in qpid::ha::BrokerReplicator::disconnected
Fix for a race condition: previously, BrokerReplicator created a separate
ConnectionObserver object to forward connection events to it. However the
Observers locking is such that it is possible for an event to arrive after
calling Observers::remove (Observers copies the pointers and delivers events
outside its lock.) This meant that it was possible for a call to
BrokerReplicator::disconnect to be made after the BrokerReplicator was deleted.
The fix is to combine BrokerReplicator and BrokerReplicator::ConnectionObserver
into a single object with one lifetime that will last until it is removed from
both the ExchangeRegistry and the ConnectionObservers.