From beb0797bb0ec63bcf19f9dff153085b548a0c0a7 Mon Sep 17 00:00:00 2001 From: Mitsunori Komatsu Date: Sat, 27 Jul 2024 17:21:21 +0900 Subject: [PATCH] fix(java): Fix memory leak in `StructSerializer.xread()` caused by re-pushing instead of popping `GenericType`. (#1768) ## What does this PR do? Fix memory leak in `StructSerializer.xread()` caused by re-pushing instead of popping `GenericType`. ## Related issues None, probably. ## Does this PR introduce any user-facing change? - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark N/A --- .../main/java/org/apache/fury/serializer/StructSerializer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/fury-core/src/main/java/org/apache/fury/serializer/StructSerializer.java b/java/fury-core/src/main/java/org/apache/fury/serializer/StructSerializer.java index e37d203b1c..5e1399bce5 100644 --- a/java/fury-core/src/main/java/org/apache/fury/serializer/StructSerializer.java +++ b/java/fury-core/src/main/java/org/apache/fury/serializer/StructSerializer.java @@ -189,7 +189,7 @@ public T xread(MemoryBuffer buffer) { Object fieldValue = fury.xreadRefByNullableSerializer(buffer, serializer); fieldAccessor.set(obj, fieldValue); if (hasGenerics) { - generics.pushGenericType(fieldGeneric); + generics.popGenericType(); } } return obj;