camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [3/4] camel git commit: CAMEL-10480 Fixed the MemoryLeak in the DatagramPacketObjectEncoder
Date Tue, 15 Nov 2016 09:09:49 GMT
CAMEL-10480 Fixed the MemoryLeak in the DatagramPacketObjectEncoder


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e56cc976
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e56cc976
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e56cc976

Branch: refs/heads/master
Commit: e56cc97612a07cedd5c67ff3c3b1e22bee525dfb
Parents: d17d59b
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Tue Nov 15 16:49:39 2016 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Tue Nov 15 16:49:39 2016 +0800

----------------------------------------------------------------------
 .../component/netty4/codec/DatagramPacketObjectEncoder.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e56cc976/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
index d57850e..9b903da 100644
--- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
+++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/codec/DatagramPacketObjectEncoder.java
@@ -39,10 +39,10 @@ public class DatagramPacketObjectEncoder extends
                           List<Object> out) throws Exception {
         if (msg.content() instanceof Serializable) {
             Serializable payload = (Serializable) msg.content();
-            ByteBuf buf = ctx.alloc().heapBuffer();
+            ByteBuf buf = ctx.alloc().buffer();
             delegateObjectEncoder.encode(ctx, payload, buf);
             AddressedEnvelope<Object, InetSocketAddress> addressedEnvelop = 
-                new DefaultAddressedEnvelope<Object, InetSocketAddress>(buf.retain(),
msg.recipient(), msg.sender());
+                new DefaultAddressedEnvelope<Object, InetSocketAddress>(buf, msg.recipient(),
msg.sender());
             out.add(addressedEnvelop);
         }
         


Mime
View raw message