From c892599494640a03a7694b96319fd1fecb714edb Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 5 Mar 2013 21:09:01 +0100 Subject: [PATCH] Fix two memory leak reported by Sonali Dutta. * src/tgbatest/ltl2tgba.cc: Calling tgbatest/ltl2tgba -M -O (which makes no sense, but that is no reason) used the "minimized" variable for two automata, overwriting one. * wrap/python/spot.i: The python bindings did not know about sba_explicit automata, causing memory leaks, and complaints from the bdd_dict. --- src/tgbatest/ltl2tgba.cc | 4 +++- wrap/python/spot.i | 26 +++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/tgbatest/ltl2tgba.cc b/src/tgbatest/ltl2tgba.cc index d69c7960c..742d3403a 100644 --- a/src/tgbatest/ltl2tgba.cc +++ b/src/tgbatest/ltl2tgba.cc @@ -1167,10 +1167,11 @@ main(int argc, char** argv) } } + const spot::tgba* monitor = 0; if (opt_monitor) { tm.start("Monitor minimization"); - minimized = a = minimize_monitor(a); + monitor = a = minimize_monitor(a); tm.stop("Monitor minimization"); assume_sba = false; // All states are accepting, so double // circles in the dot output are @@ -1620,6 +1621,7 @@ main(int argc, char** argv) delete product_to_free; delete system; delete expl; + delete monitor; delete minimized; delete degeneralized; delete aut_scc; diff --git a/wrap/python/spot.i b/wrap/python/spot.i index 4fe6442f2..c2b9916d0 100644 --- a/wrap/python/spot.i +++ b/wrap/python/spot.i @@ -238,7 +238,7 @@ using namespace spot; %template(explicit_string_tgba) spot::tgba_explicit; -%template(explicit__number_tgba) +%template(explicit_number_tgba) spot::tgba_explicit; %template(explicit_formula_tgba) spot::tgba_explicit; @@ -253,6 +253,30 @@ using namespace spot; spot::explicit_conf, state_explicit_formula>; +%template(explicit_graph__string_sba) + spot::explicit_graph; +%template(explicit_graph__number_sba) + spot::explicit_graph; +%template(explicit_graph__formula_sba) + spot::explicit_graph; + +%template(explicit_string_sba) + spot::sba_explicit; +%template(explicit_number_sba) + spot::sba_explicit; +%template(explicit_formula_sba) + spot::sba_explicit; + +%template(explicit_string__sba) + spot::explicit_conf, + state_explicit_string>; +%template(explicit_number__sba) + spot::explicit_conf, + state_explicit_number>; +%template(explicit_formula__sba) + spot::explicit_conf, + state_explicit_formula>; + %include "tgbaalgos/degen.hh" %include "tgbaalgos/dottydec.hh" %include "tgbaalgos/dotty.hh"