Fixing a Usage leak in broker when subscribing to a topic using selector: AMQ-1889

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@686217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-08-15 14:06:21 +00:00
parent 5a81bbb375
commit 293a6983eb

View File

@ -570,13 +570,15 @@ public class Topic extends BaseDestination implements Task{
return; return;
} }
} }
MessageEvaluationContext msgContext = context.getMessageEvaluationContext(); MessageEvaluationContext msgContext = context.getMessageEvaluationContext();
msgContext.setDestination(destination); msgContext.setDestination(destination);
msgContext.setMessageReference(message); msgContext.setMessageReference(message);
if (!dispatchPolicy.dispatch(message, msgContext, consumers)) { if (!dispatchPolicy.dispatch(message, msgContext, consumers)) {
onMessageWithNoConsumers(context, message); onMessageWithNoConsumers(context, message);
} }
msgContext.clear();
} finally { } finally {
dispatchValve.decrement(); dispatchValve.decrement();
} }