]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merge of (#10072) to Vaadin 7. 03/603/1
authorAnna Koskinen <anna@vaadin.com>
Wed, 9 Jan 2013 08:49:34 +0000 (10:49 +0200)
committerAnna Koskinen <anna@vaadin.com>
Wed, 9 Jan 2013 11:20:51 +0000 (13:20 +0200)
Clean up map of dropped file receivers when streaming of a file starts.

Change-Id: I8f0d87505f4d82f906760a7e5e29546bb2b74e77

server/src/com/vaadin/ui/DragAndDropWrapper.java

index 5ec8fd5c76af10d5b57e9f114a66a8f474516dc9..23641f285e7d754b7bdd8db72fe79cff4ffcff88 100644 (file)
@@ -228,7 +228,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
                 String id = entry.getKey();
                 Html5File html5File = entry.getValue();
                 if (html5File.getStreamVariable() != null) {
-                    target.addVariable(this, "rec-" + id, new ProxyReceiver(
+                    target.addVariable(this, "rec-" + id, new ProxyReceiver(id,
                             html5File));
                     // these are cleaned from receivers once the upload has
                     // started
@@ -278,9 +278,11 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
 
     final class ProxyReceiver implements StreamVariable {
 
+        private String id;
         private Html5File file;
 
-        public ProxyReceiver(Html5File file) {
+        public ProxyReceiver(String id, Html5File file) {
+            this.id = id;
             this.file = file;
         }
 
@@ -313,7 +315,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
                         new ReceivingEventWrapper(event));
             }
             // no need tell to the client about this receiver on next paint
-            receivers.remove(file);
+            receivers.remove(id);
             // let the terminal GC the streamvariable and not to accept other
             // file uploads to this variable
             event.disposeStreamVariable();