Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 0301f16b authored by Laurent Montel's avatar Laurent Montel 😁

Fix mem leak found by asan

parent 0242f173
......@@ -46,7 +46,16 @@ Interpreter::Interpreter(QObject* parent, bool testing)
parser = new Parser(testing);
executer = new Executer(testing);
m_state = Uninitialized;
m_state = Uninitialized;
}
Interpreter::~Interpreter()
{
errorList->clear();
delete errorList;
delete tokenizer;
delete parser;
delete executer;
}
void Interpreter::initialize(const QString& inString)
......
......@@ -55,7 +55,7 @@ class Interpreter : public QObject
/**
* Default Destructor
*/
virtual ~Interpreter() {}
virtual ~Interpreter();
enum State {
Uninitialized, // unusable
......
......@@ -24,6 +24,10 @@
#include <KLocalizedString>
Parser::~Parser()
{
}
void Parser::initialize(Tokenizer* _tokenizer, ErrorList* _errorList)
{
tokenizer = _tokenizer;
......@@ -31,7 +35,7 @@ void Parser::initialize(Tokenizer* _tokenizer, ErrorList* _errorList)
rootNode = new TreeNode(new Token(Token::Root, "root", 0, 0, 0, 0));
currentScope = rootNode;
newScope = 0;
newScope = nullptr;
finished = false;
nextToken();
......
......@@ -50,7 +50,7 @@ class Parser
/**
* @short Destructor. Does nothing special.
*/
~Parser() {}
~Parser();
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment