From a2457b2f2357bbdb32b184e25ddd49698efc800e Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 27 Jun 2018 14:25:15 +0300 Subject: Memory leak fix in ConnectorTracker (#10996) --- server/src/main/java/com/vaadin/ui/ConnectorTracker.java | 3 ++- server/src/main/java/com/vaadin/ui/Upload.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java index 0c331ae8ee..de7935d9fb 100644 --- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java @@ -869,7 +869,8 @@ public class ConnectorTracker implements Serializable { } Map nameToStreamVar = pidToNameToStreamVariable .get(connectorId); - nameToStreamVar.remove(variableName); + StreamVariable streamVar = nameToStreamVar.remove(variableName); + streamVariableToSeckey.remove(streamVar); if (nameToStreamVar.isEmpty()) { pidToNameToStreamVariable.remove(connectorId); } diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java index 7f5727f078..ca9f2dc7f0 100644 --- a/server/src/main/java/com/vaadin/ui/Upload.java +++ b/server/src/main/java/com/vaadin/ui/Upload.java @@ -1118,6 +1118,8 @@ public class Upload extends AbstractComponent fireUploadSuccess(event.getFileName(), event.getMimeType(), event.getContentLength()); endUpload(); + if(lastStartedEvent != null) + lastStartedEvent.disposeStreamVariable(); } @Override @@ -1136,6 +1138,8 @@ public class Upload extends AbstractComponent } } finally { endUpload(); + if(lastStartedEvent != null) + lastStartedEvent.disposeStreamVariable(); } } }; -- cgit v1.2.3