summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-14 01:47:07 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-14 01:47:07 +0000
commit2a37926cdaf58a59c4c607a9043c018ca699307d (patch)
treeb896f330e3f21a780ba28f15b991ad734c74a574
parentRefactor metadata (diff)
downloadslicer-2a37926cdaf58a59c4c607a9043c018ca699307d.tar.bz2
slicer-2a37926cdaf58a59c4c607a9043c018ca699307d.tar.xz
slicer-2a37926cdaf58a59c4c607a9043c018ca699307d.zip
Add missing calls to unit destroy on error
-rw-r--r--slicer/tool/parser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp
index 633b16f..7759ebc 100644
--- a/slicer/tool/parser.cpp
+++ b/slicer/tool/parser.cpp
@@ -726,10 +726,12 @@ namespace Slicer {
int parseStatus = u->parse(slicePath, cppHandle, false);
if (!icecpp->close()) {
+ u->destroy();
throw CompilerError("preprocess close failed");
}
if (parseStatus == EXIT_FAILURE) {
+ u->destroy();
throw CompilerError("unit parse failed");
}