From 237fde1f76e8d2c1b90dbc17cfdea6f7f7494922 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Wed, 31 Aug 2016 09:57:46 +0800 Subject: [PATCH] fix crash during shutdown. Issue #719 Signed-off-by: Nikolaj Bjorner --- src/ast/ast.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp index 050ada521..440179ba8 100644 --- a/src/ast/ast.cpp +++ b/src/ast/ast.cpp @@ -78,7 +78,10 @@ void parameter::del_eh(ast_manager & m, family_id fid) { } else if (is_external()) { SASSERT(fid != null_family_id); - m.get_plugin(fid)->del(*this); + decl_plugin * plugin = m.get_plugin(fid); + if (plugin) { + plugin->del(*this); + } } } @@ -1418,9 +1421,10 @@ ast_manager::~ast_manager() { } it = m_plugins.begin(); for (; it != end; ++it) { - if (*it) + if (*it) dealloc(*it); } + m_plugins.reset(); while (!m_ast_table.empty()) { DEBUG_CODE(std::cout << "ast_manager LEAKED: " << m_ast_table.size() << std::endl;); ptr_vector roots;