diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2017-10-10 14:45:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-10 14:45:36 -0700 |
commit | b7d0c09bd12b9d0f46deab199714ce3441206d7f (patch) | |
tree | c894889a35ce3f5b446e9d160af88e74aeb4c63e /src/theory/quantifiers_engine.h | |
parent | 8c860213ca3a43e1fe483accb4b2b928ae14028e (diff) |
Fix memory leak in quantifiers engine (#1219)
Commit 96a0bc3b022b67b5ab79bf2ab087573c65a8d248 introduced a memory leak
where d_quant_attr was not deleted when the QuantifiersEngine was
destroyed. This commit fixes the issue by turning d_quant_attr into an
std::unique_ptr.
Diffstat (limited to 'src/theory/quantifiers_engine.h')
-rw-r--r-- | src/theory/quantifiers_engine.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/theory/quantifiers_engine.h b/src/theory/quantifiers_engine.h index c72038659..b1608e497 100644 --- a/src/theory/quantifiers_engine.h +++ b/src/theory/quantifiers_engine.h @@ -19,6 +19,7 @@ #include <iostream> #include <map> +#include <memory> #include <unordered_map> #include "context/cdchunk_list.h" @@ -200,7 +201,7 @@ private: /** term utilities */ quantifiers::TermUtil* d_term_util; /** quantifiers attributes */ - quantifiers::QuantAttributes* d_quant_attr; + std::unique_ptr<quantifiers::QuantAttributes> d_quant_attr; /** all triggers will be stored in this trie */ inst::TriggerTrie* d_tr_trie; /** extended model object */ @@ -379,7 +380,9 @@ public: /** get term utilities */ quantifiers::TermUtil* getTermUtil() { return d_term_util; } /** get quantifiers attributes */ - quantifiers::QuantAttributes* getQuantAttributes() { return d_quant_attr; } + quantifiers::QuantAttributes* getQuantAttributes() { + return d_quant_attr.get(); + } /** get trigger database */ inst::TriggerTrie* getTriggerDatabase() { return d_tr_trie; } /** add term to database */ |