You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2016/10/01 21:41:18 UTC

wicket git commit: WICKET-6250 always clear reference to fileUploads in onDetach()

Repository: wicket
Updated Branches:
  refs/heads/master 0dac0d55c -> c615cca9e


WICKET-6250 always clear reference to fileUploads in onDetach()


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

Branch: refs/heads/master
Commit: c615cca9e0d1a6236f321e4692da4b0a3f99b9fe
Parents: 0dac0d5
Author: Sven Meier <sv...@apache.org>
Authored: Sat Oct 1 23:38:35 2016 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Sat Oct 1 23:40:41 2016 +0200

----------------------------------------------------------------------
 .../html/form/upload/FileUploadField.java       | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/c615cca9/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/FileUploadField.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/FileUploadField.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/FileUploadField.java
index 256c076..e604fae 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/FileUploadField.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/FileUploadField.java
@@ -183,18 +183,21 @@ public class FileUploadField extends FormComponent<List<FileUpload>>
 	@Override
 	protected void onDetach()
 	{
-		if ((fileUploads != null) && forceCloseStreamsOnDetach())
+		if (fileUploads != null)
 		{
-			for (FileUpload fu : fileUploads)
-			{
-				fu.closeStreams();
-			}
-			fileUploads = null;
+			if (forceCloseStreamsOnDetach()) {
+				for (FileUpload fu : fileUploads)
+				{
+					fu.closeStreams();
+				}
 
-			if (getModel() != null)
-			{
-				getModel().setObject(null);
+				if (getModel() != null)
+				{
+					getModel().setObject(null);
+				}
 			}
+
+			fileUploads = null;
 		}
 		super.onDetach();
 	}