fixed bug in channel.get() calls
This commit is contained in:
parent
e299aa5fac
commit
d99b117a60
|
|
@ -32,14 +32,17 @@ Deferred *DeferredGet::reportSuccess(uint32_t messageCount) const
|
||||||
// we now know the name, so we can install the message callback on the channel
|
// we now know the name, so we can install the message callback on the channel
|
||||||
_channel->install("", [channel, messageCallback, finalizeCallback](const Message &message, uint64_t deliveryTag, bool redelivered) {
|
_channel->install("", [channel, messageCallback, finalizeCallback](const Message &message, uint64_t deliveryTag, bool redelivered) {
|
||||||
|
|
||||||
// we can remove the callback now from the channel
|
// install a monitor to deal with the case that the channel is removed
|
||||||
channel->uninstall("");
|
Monitor monitor(channel);
|
||||||
|
|
||||||
// call the callbacks
|
// call the callbacks
|
||||||
if (messageCallback) messageCallback(message, deliveryTag, redelivered);
|
if (messageCallback) messageCallback(message, deliveryTag, redelivered);
|
||||||
|
|
||||||
// call the finalize callback
|
// call the finalize callback
|
||||||
if (finalizeCallback) finalizeCallback();
|
if (finalizeCallback) finalizeCallback();
|
||||||
|
|
||||||
|
// we can remove the callback now from the channel
|
||||||
|
if (monitor.valid()) channel->uninstall("");
|
||||||
});
|
});
|
||||||
|
|
||||||
// return next object
|
// return next object
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue