Skip to content

Commit

Permalink
memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Sep 25, 2023
1 parent 292e30b commit 8f4a230
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/Surelog/Design/FileContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FileContent : public DesignComponent {
public:
FileContent(PathId fileId, Library* library, SymbolTable* symbolTable,
ErrorContainer* errors, FileContent* parent, PathId fileChunkId);
~FileContent() override = default;
~FileContent();

void setLibrary(Library* lib) { m_library = lib; }

Expand Down
6 changes: 6 additions & 0 deletions src/Design/FileContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ FileContent::FileContent(PathId fileId, Library* library,
InvalidNodeId, InvalidNodeId, InvalidNodeId, InvalidNodeId);
}

FileContent::~FileContent() {
for (auto de : m_elements) {
delete de;
}
}

std::string_view FileContent::getName() const {
return FileSystem::getInstance()->toPath(m_fileId);
}
Expand Down
2 changes: 2 additions & 0 deletions src/SourceCompile/CompileSourceFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <Surelog/ErrorReporting/ErrorContainer.h>
#include <Surelog/Library/Library.h>
#include <Surelog/Package/Precompiled.h>
#include <Surelog/SourceCompile/AnalyzeFile.h>
#include <Surelog/SourceCompile/CompileSourceFile.h>
#include <Surelog/SourceCompile/Compiler.h>
#include <Surelog/SourceCompile/ParseFile.h>
Expand Down Expand Up @@ -133,6 +134,7 @@ CompileSourceFile::~CompileSourceFile() {
}
m_antlrPpMacroMap.clear();
m_antlrPpFileMap.clear();
if (m_fileAnalyzer) delete m_fileAnalyzer;
}

uint64_t CompileSourceFile::getJobSize(Action action) const {
Expand Down
4 changes: 3 additions & 1 deletion src/SourceCompile/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,8 @@ PreprocessFile::AntlrParserHandler* Compiler::getAntlrPpHandlerForId(
bool Compiler::parseLibrariesDef_() {
ParseLibraryDef* libParser = new ParseLibraryDef(
m_commandLineParser, m_errors, m_symbolTable, m_librarySet, m_configSet);
return libParser->parseLibrariesDefinition();
bool result = libParser->parseLibrariesDefinition();
delete libParser;
return result;
}
} // namespace SURELOG
2 changes: 1 addition & 1 deletion third_party/UHDM
Submodule UHDM updated 1 files
+5 −4 templates/ExprEval.cpp

0 comments on commit 8f4a230

Please sign in to comment.