Fix for potential memory leak from creation of KahaDBTopicMessageStore.
This commit is contained in:
Timothy Bish 2015-05-14 16:57:06 -04:00
parent 181e4d4617
commit c5a1b86062
1 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,6 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.FutureTask; import java.util.concurrent.FutureTask;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
@ -430,6 +429,7 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter {
// sync add? (for async, future present from getFutureOrSequenceLong) // sync add? (for async, future present from getFutureOrSequenceLong)
Object possibleFuture = message.getMessageId().getFutureOrSequenceLong(); Object possibleFuture = message.getMessageId().getFutureOrSequenceLong();
@Override
public void sequenceAssignedWithIndexLocked(final long sequence) { public void sequenceAssignedWithIndexLocked(final long sequence) {
message.getMessageId().setFutureOrSequenceLong(sequence); message.getMessageId().setFutureOrSequenceLong(sequence);
if (indexListener != null) { if (indexListener != null) {
@ -724,8 +724,10 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter {
public KahaDBTopicMessageStore(ActiveMQTopic destination) throws IOException { public KahaDBTopicMessageStore(ActiveMQTopic destination) throws IOException {
super(destination); super(destination);
this.subscriptionCount.set(getAllSubscriptions().length); this.subscriptionCount.set(getAllSubscriptions().length);
if (isConcurrentStoreAndDispatchTopics()) {
asyncTopicMaps.add(asyncTaskMap); asyncTopicMaps.add(asyncTaskMap);
} }
}
@Override @Override
public ListenableFuture<Object> asyncAddTopicMessage(final ConnectionContext context, final Message message) public ListenableFuture<Object> asyncAddTopicMessage(final ConnectionContext context, final Message message)