Modify GenFfsFileTask.
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / GenSectionTask.java
index a2bbf4f..4cd7a96 100644 (file)
@@ -303,11 +303,12 @@ public class GenSectionTask extends Task implements EfiDefine, Section, FfsTypes
                         System.out.print(e.getMessage());\r
                         throw new BuildException(\r
                                 "Compress.toBuffer failed at section");\r
+                    } finally {\r
+                        if (Do != null){\r
+                            Do.close();\r
+                        }\r
                     }\r
-\r
                 }\r
-                Do.close();\r
-\r
                 //\r
                 // Call compress\r
                 //\r
@@ -364,7 +365,7 @@ public class GenSectionTask extends Task implements EfiDefine, Section, FfsTypes
                 }\r
             } catch (Exception e) {\r
                 throw new BuildException("compress.toBuffer failed!\n");\r
-            }\r
+            } \r
         } else {\r
             Section sect;\r
             Iterator sectionIter = this.sectFileList.iterator();\r