You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
an AMQP can manager several Exchanges Or QUEUEs.
every of them have their own channel, right?
if I call delete AMQP* directly,
in the Destructor
channels.size() is not zero, but AMQPBase* in the vector is un-reachable.
the delete *i would throw;
So I suggest call AMQP::closeChannel() in its Destructor.
AMQPBase::~AMQPBase() {
this->closeChannel();
}
AMQP::~AMQP() {
if (channels.size()) {
vector<AMQPBase*>::iterator i;
for (i=channels.begin(); i!=channels.end();) {
delete *i;
}
}
an AMQP can manager several Exchanges Or QUEUEs.
every of them have their own channel, right?
if I call delete AMQP* directly,
in the Destructor
channels.size() is not zero, but AMQPBase* in the vector is un-reachable.
the delete *i would throw;
So I suggest call AMQP::closeChannel() in its Destructor.
AMQPBase::~AMQPBase() {
this->closeChannel();
}
AMQP::~AMQP() {
if (channels.size()) {
vector<AMQPBase*>::iterator i;
for (i=channels.begin(); i!=channels.end();) {
delete *i;
}
}
};
The text was updated successfully, but these errors were encountered: