From 34e4bfe9c9ae532716ed8b293242524f0c2ef671 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Mon, 14 Jul 2025 15:20:30 +0200 Subject: [PATCH] fixed some memory leaks --- src/ast/expressions/if_then_else.cpp | 6 ++++++ src/ast/expressions/if_then_else.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ast/expressions/if_then_else.cpp b/src/ast/expressions/if_then_else.cpp index 5648d10..53de1e5 100644 --- a/src/ast/expressions/if_then_else.cpp +++ b/src/ast/expressions/if_then_else.cpp @@ -20,4 +20,10 @@ namespace ast { ss << "else" << alternative->str(); return ss.str(); }; + + if_then_else::~if_then_else() { + delete condition; + delete consequence; + delete alternative; + } } // namespace ast diff --git a/src/ast/expressions/if_then_else.hpp b/src/ast/expressions/if_then_else.hpp index 99d0f46..cf2c8fd 100644 --- a/src/ast/expressions/if_then_else.hpp +++ b/src/ast/expressions/if_then_else.hpp @@ -15,5 +15,6 @@ namespace ast { std::string token_literal() const override; std::string str() const override; + ~if_then_else(); }; } // namespace ast