From 3543fa4caa54a850a3aa5d7696d43d5ea78abb05 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 3 Oct 2021 23:07:33 +0200 Subject: [PATCH] patterns: Fixed pattern limitting dangling pointer --- .../libimhex/include/hex/pattern_language/pattern_data.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp b/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp index 658331ea7..f989c4243 100644 --- a/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp +++ b/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp @@ -62,9 +62,9 @@ namespace hex::pl { } PatternCreationLimiter(const PatternCreationLimiter &other) { - if (this->m_evaluator == nullptr) return; - this->m_evaluator = other.m_evaluator; + + if (this->m_evaluator == nullptr) return; this->m_evaluator->patternCreated(); } @@ -75,7 +75,7 @@ namespace hex::pl { } private: - Evaluator *m_evaluator; + Evaluator *m_evaluator = nullptr; }; class PatternData : public PatternCreationLimiter {