/[Apache-SVN]
ViewVC logotype

Revision 1749780


Jump to revision: Previous Next
Author: aconway
Date: Wed Jun 22 20:41:43 2016 UTC (7 years, 10 months ago)
Changed paths: 4
Log Message:
QPID-7306: Memory management error in Link/Bridge

qpid::broker Link and Bridge use Connection::requestIOProcessing() to register
callbacks in the connection thread. They were binding a plain "this" pointer to
the callback, but the classes are managed by boost::shared_ptr so if all the
shared_ptr were released, the callback could happen on a dangling pointer.

This fix uses boost::weak_ptr in the callbacks, so if all shared_ptr instances
are released, we don't use the dead pointer.

Link::destroy cannot be skipped, so use a shared_ptr for that.

Changed paths

Path Details
Directoryqpid/trunk/qpid/cpp/src/qpid/broker/Bridge.cpp modified , text changed
Directoryqpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp modified , text changed
Directoryqpid/trunk/qpid/cpp/src/qpid/broker/Link.h modified , text changed
Directoryqpid/trunk/qpid/cpp/src/qpid/broker/amqp_0_10/Connection.h modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26