summaryrefslogtreecommitdiff
path: root/qpid/cpp/lib/broker/BrokerMessage.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-12-06 17:51:42 +0000
committerGordon Sim <gsim@apache.org>2006-12-06 17:51:42 +0000
commit293c124f6e49530a10e7b1c1bcb90e41ec05b420 (patch)
treea874947bfbcb1283833c4d3860f8aee3cf1a5350 /qpid/cpp/lib/broker/BrokerMessage.cpp
parent3fb852873fc09814c1c4b09866f2f266b3f4e1ee (diff)
downloadqpid-python-293c124f6e49530a10e7b1c1bcb90e41ec05b420.tar.gz
Allow non-durable messages to be lazy-loaded. Cleanup of lazy-loaded messages
that are never enqueued. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@483165 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/lib/broker/BrokerMessage.cpp')
-rw-r--r--qpid/cpp/lib/broker/BrokerMessage.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qpid/cpp/lib/broker/BrokerMessage.cpp b/qpid/cpp/lib/broker/BrokerMessage.cpp
index d30cd12bc3..598de2d590 100644
--- a/qpid/cpp/lib/broker/BrokerMessage.cpp
+++ b/qpid/cpp/lib/broker/BrokerMessage.cpp
@@ -53,7 +53,9 @@ Message::Message(Buffer& buffer, bool headersOnly, u_int32_t contentChunkSize) :
Message::Message() : publisher(0), mandatory(false), immediate(false), redelivered(false), size(0), persistenceId(0){}
-Message::~Message(){}
+Message::~Message(){
+ if (content.get()) content->destroy();
+}
void Message::setHeader(AMQHeaderBody::shared_ptr _header){
this->header = _header;
@@ -205,6 +207,9 @@ u_int64_t Message::expectedContentSize()
void Message::releaseContent(MessageStore* store)
{
Mutex::ScopedLock locker(contentLock);
+ if (!isPersistent() && persistenceId == 0) {
+ store->stage(this);
+ }
if (!content.get() || content->size() > 0) {
//set content to lazy loading mode (but only if there is stored content):