git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1326692 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2012-04-16 17:34:00 +00:00
parent 04aa9c5161
commit fb915c3dc6
1 changed files with 7 additions and 5 deletions

View File

@ -2002,12 +2002,14 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
// Check if the message is reference by any other subscription.
Long count = sd.messageReferences.get(messageSequence);
if (count != null){
long references = count.longValue() - 1;
if (references > 0) {
sd.messageReferences.put(messageSequence, Long.valueOf(references));
return;
} else {
sd.messageReferences.remove(messageSequence);
if (references > 0) {
sd.messageReferences.put(messageSequence, Long.valueOf(references));
return;
} else {
sd.messageReferences.remove(messageSequence);
}
}
// Find all the entries that need to get deleted.