From de2673ba7e839a39615aba05aa86bc62f6abd246 Mon Sep 17 00:00:00 2001 From: Matthew Newhook Date: Mon, 12 Jan 2009 14:38:58 -0330 Subject: another fix for 3396. --- cpp/src/Slice/JavaUtil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cpp/src/Slice/JavaUtil.cpp') diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp index 725e5e60268..e4ee4d6c392 100644 --- a/cpp/src/Slice/JavaUtil.cpp +++ b/cpp/src/Slice/JavaUtil.cpp @@ -223,6 +223,12 @@ Slice::JavaGenerator::JavaGenerator(const string& dir, Slice::FeatureProfile pro Slice::JavaGenerator::~JavaGenerator() { + // If open throws an exception other generators could be left open + // during the stack unwind. + if(_out != 0) + { + close(); + } assert(_out == 0); } -- cgit v1.2.3