From 367f628b5cf7d048ff24672375e15806f82f716c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 6 Sep 2018 14:02:58 +0200 Subject: [PATCH] [calculation] Free the pool of expressions when tidying the application --- apps/calculation/calculation.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/apps/calculation/calculation.cpp b/apps/calculation/calculation.cpp index e21e4abcd..2f8e8fae4 100644 --- a/apps/calculation/calculation.cpp +++ b/apps/calculation/calculation.cpp @@ -107,19 +107,10 @@ bool Calculation::isEmpty() { } void Calculation::tidy() { -// TODO: we might want to do something here? To empty the pool? -/* if (m_input != nullptr) { - delete m_input; - } - m_input = nullptr; - if (m_exactOutput != nullptr) { - delete m_exactOutput; - } - m_exactOutput = nullptr; - if (m_approximateOutput != nullptr) { - delete m_approximateOutput; - } - m_approximateOutput = nullptr;*/ + /* Uninitialized all Expression stored to free the Pool */ + m_input = Expression(); + m_exactOutput = Expression(); + m_approximateOutput = Expression(); m_height = -1; m_equalSign = EqualSign::Unknown; }