From d22ecba9b6e2c34182b13b3fa0cdc239d3414d2e Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 10 Jan 2016 21:02:31 +0100 Subject: [PATCH] twa: call unregister_all_my_variables() Fixes #129. * spot/twa/twa.cc (~twa): call unregister_all_my_variables() * spot/twa/twagraph.hh, spot/twa/twaproduct.cc, spot/twaalgos/stutter.cc: Simplify. * NEWS: Mention the change. --- NEWS | 6 +++++- spot/twa/twa.cc | 1 + spot/twa/twagraph.hh | 1 - spot/twa/twaproduct.cc | 1 - spot/twaalgos/stutter.cc | 5 ----- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index f291cd94e..17d9ceba5 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ New in spot 1.99.6a (not yet released) Command-line tools: - * BACKWARD INCOMPATIBILE CHANGE: All tools that output automata now + * BACKWARD INCOMPATIBLE CHANGE: All tools that output automata now use the HOA format by default instead of the GraphViz output. This makes it easier to pipe several commands. @@ -41,6 +41,10 @@ New in spot 1.99.6a (not yet released) renamed to spot/ltsmin/, so that installed and non-installed directories can be used similarly. + * twa::~twa() is now calling + get_dict()->unregister_all_my_variable(this); + so this does not need to be done in any subclass. + * is_inherently_weak_automaton() is a new function, and check_strength() has been modified to also check inherently weak automata. diff --git a/spot/twa/twa.cc b/spot/twa/twa.cc index 06719297a..cd34922c4 100644 --- a/spot/twa/twa.cc +++ b/spot/twa/twa.cc @@ -43,6 +43,7 @@ namespace spot last_support_conditions_input_->destroy(); delete iter_cache_; release_named_properties(); + get_dict()->unregister_all_my_variables(this); } bdd diff --git a/spot/twa/twagraph.hh b/spot/twa/twagraph.hh index cb486ada2..0342e6f81 100644 --- a/spot/twa/twagraph.hh +++ b/spot/twa/twagraph.hh @@ -202,7 +202,6 @@ namespace spot virtual ~twa_graph() { - get_dict()->unregister_all_my_variables(this); // Prevent this state from being destroyed by ~twa(), // as the state will be destroyed when g_ is destroyed. last_support_conditions_input_ = nullptr; diff --git a/spot/twa/twaproduct.cc b/spot/twa/twaproduct.cc index 5bf1018b2..3fb7bfecb 100644 --- a/spot/twa/twaproduct.cc +++ b/spot/twa/twaproduct.cc @@ -315,7 +315,6 @@ namespace spot twa_product::~twa_product() { - get_dict()->unregister_all_my_variables(this); // Prevent these states from being destroyed by ~tgba(): they // will be destroyed before when the pool is destructed. if (last_support_conditions_input_) diff --git a/spot/twaalgos/stutter.cc b/spot/twaalgos/stutter.cc index 53b8d47de..91bcc3261 100644 --- a/spot/twaalgos/stutter.cc +++ b/spot/twaalgos/stutter.cc @@ -215,11 +215,6 @@ namespace spot acc_.set_generalized_buchi(); } - virtual ~tgbasl() - { - get_dict()->unregister_all_my_variables(this); - } - virtual const state* get_init_state() const override { return new state_tgbasl(a_->get_init_state(), bddfalse); -- GitLab