From 2a37926cdaf58a59c4c607a9043c018ca699307d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 14 Dec 2020 01:47:07 +0000 Subject: Add missing calls to unit destroy on error --- slicer/tool/parser.cpp | 2 ++ 1 file changed, 2 insertions(+) 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"); } -- cgit v1.2.3