3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

fixes issue #143 and memory leak on theory plugin setup

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-06-26 09:03:56 +02:00
parent 47da717947
commit e81dc5a0a0
4 changed files with 12 additions and 10 deletions

View file

@ -2698,8 +2698,10 @@ namespace smt {
#endif
void context::register_plugin(theory * th) {
if (m_theories.get_plugin(th->get_family_id()) != 0)
if (m_theories.get_plugin(th->get_family_id()) != 0) {
dealloc(th);
return; // context already has a theory for the given family id.
}
SASSERT(std::find(m_theory_set.begin(), m_theory_set.end(), th) == m_theory_set.end());
SASSERT(!already_internalized_theory(th));
th->init(this);