Commit 32810aeb authored by Andre Freyssinet's avatar Andre Freyssinet

Avoids memory leak.

parent 79e8fab8
/*
* Copyright (C) 2001 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2021 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 BULL
* Copyright (C) 1996 - 2000 INRIA
*
......@@ -359,6 +359,7 @@ public final class Message implements Serializable, Encodable {
void free() {
not = null; /* to let gc do its work */
stringId = null;
serializedNot = null;
pool.freeElement(this);
}
......@@ -427,6 +428,7 @@ public final class Message implements Serializable, Encodable {
// Writes notification object
if (not.getEncodableClassId() == -1) {
encoder.encodeBoolean(false);
// The SerializableWrapper is created in getEncodedSize method.
if (serializedNot == null) {
serializedNot = new SerializableWrapper(not);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment