From f7aee273a7a0e4d855e7609f0c972d427e64e04f Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Wed, 23 Dec 2015 02:21:03 +0200 Subject: [PATCH] Ensured comments are properly destroyed thus fixing a memory leak. Signed-off-by: Dimitar Dobrev --- src/CppParser/AST.cpp | 2 ++ src/CppParser/AST.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/CppParser/AST.cpp b/src/CppParser/AST.cpp index 33d42f15..fd6c26d1 100644 --- a/src/CppParser/AST.cpp +++ b/src/CppParser/AST.cpp @@ -794,6 +794,8 @@ TranslationUnit* ASTContext::FindOrCreateModule(std::string File) // Comments Comment::Comment(CommentKind kind) : Kind(kind) {} +Comment::~Comment() {} + DEF_STRING(RawComment, Text) DEF_STRING(RawComment, BriefText) diff --git a/src/CppParser/AST.h b/src/CppParser/AST.h index 6f908763..e055f177 100644 --- a/src/CppParser/AST.h +++ b/src/CppParser/AST.h @@ -933,6 +933,7 @@ class CS_API CS_ABSTRACT Comment { public: Comment(CommentKind kind); + virtual ~Comment(); CommentKind Kind; };