From ec76e4b3cf39d76f6c284f576a969d32ff326e64 Mon Sep 17 00:00:00 2001 From: Helge Waastad Date: Tue, 20 Jun 2017 18:56:58 +0200 Subject: [PATCH] ARTEMIS-1243 Release ReferenceCounted messages (cherry picked from commit eaadc2472934ec1c18e3146b9ee94427d7719df4) --- .../artemis/core/protocol/mqtt/MQTTProtocolHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java index be0197f674..81d3197f82 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java @@ -37,6 +37,7 @@ import io.netty.handler.codec.mqtt.MqttSubAckPayload; import io.netty.handler.codec.mqtt.MqttSubscribeMessage; import io.netty.handler.codec.mqtt.MqttUnsubAckMessage; import io.netty.handler.codec.mqtt.MqttUnsubscribeMessage; +import io.netty.util.ReferenceCountUtil; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry; @@ -147,6 +148,8 @@ public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter { } catch (Exception e) { log.debug("Error processing Control Packet, Disconnecting Client", e); disconnect(true); + } finally { + ReferenceCountUtil.release(msg); } }