3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-02 05:15:52 +00:00

garbage collect all api::object references when calling del_context. Request issue #679

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-07-13 22:26:21 -07:00
parent f30fb7639e
commit b080e3a216
25 changed files with 115 additions and 56 deletions

View file

@ -23,7 +23,7 @@ Revision History:
struct Z3_model_ref : public api::object {
model_ref m_model;
Z3_model_ref() {}
Z3_model_ref(api::context& c): api::object(c) {}
virtual ~Z3_model_ref() {}
};
@ -34,7 +34,7 @@ inline model * to_model_ref(Z3_model s) { return to_model(s)->m_model.get(); }
struct Z3_func_interp_ref : public api::object {
model_ref m_model; // must have it to prevent reference to m_func_interp to be killed.
func_interp * m_func_interp;
Z3_func_interp_ref(model * m):m_model(m), m_func_interp(0) {}
Z3_func_interp_ref(api::context& c, model * m): api::object(c), m_model(m), m_func_interp(0) {}
virtual ~Z3_func_interp_ref() {}
};
@ -46,7 +46,7 @@ struct Z3_func_entry_ref : public api::object {
model_ref m_model; // must have it to prevent reference to m_func_entry to be killed.
func_interp * m_func_interp;
func_entry const * m_func_entry;
Z3_func_entry_ref(model * m):m_model(m), m_func_interp(0), m_func_entry(0) {}
Z3_func_entry_ref(api::context& c, model * m):api::object(c), m_model(m), m_func_interp(0), m_func_entry(0) {}
virtual ~Z3_func_entry_ref() {}
};