Test "ltl2tgba -FC" and plug the memory leaks of scc_map.
* src/tgbaalgos/scc.hh (scc_map::~scc_map): Declare it. * src/tgbaalgos/scc.cc (scc_map::~scc_map): Implement it. (scc_map::build_map): Delete duplicate states. * src/tbbatest/ltl2tgba.test: Run ltl2tgba -FV to catch memory leaks with valgrind.
This commit is contained in:
parent
d74578ef6e
commit
352984293a
4 changed files with 30 additions and 1 deletions
|
|
@ -44,6 +44,19 @@ namespace spot
|
|||
{
|
||||
}
|
||||
|
||||
scc_map::~scc_map()
|
||||
{
|
||||
hash_type::iterator i = h_.begin();
|
||||
|
||||
while (i != h_.end())
|
||||
{
|
||||
// Advance the iterator before deleting the key.
|
||||
const state* s = i->first;
|
||||
++i;
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
scc_map::initial() const
|
||||
{
|
||||
|
|
@ -182,6 +195,10 @@ namespace spot
|
|||
continue;
|
||||
}
|
||||
|
||||
// If we now the state, reuse the previous object.
|
||||
delete dest;
|
||||
dest = spi->first;
|
||||
|
||||
// Have we reached a maximal SCC?
|
||||
if (spi->second >= 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue