From ac41825efd786eabf9ab3a5238087934770e0d72 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 20 Jun 2012 08:30:11 +0200 Subject: [PATCH] * src/tgbaalgos/degen.cc (~unicity_table): Accommodate g++ 4.0.1. --- src/tgbaalgos/degen.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tgbaalgos/degen.cc b/src/tgbaalgos/degen.cc index c1f8eec70..2cd2f5fd4 100644 --- a/src/tgbaalgos/degen.cc +++ b/src/tgbaalgos/degen.cc @@ -88,8 +88,13 @@ namespace spot ~unicity_table() { - for (uniq_set::iterator i = m.begin(); i != m.end(); ++i) - (*i)->destroy(); + for (uniq_set::iterator i = m.begin(); i != m.end();) + { + // Advance the iterator before destroying its key. This + // avoid issues with old g++ implementations. + uniq_set::iterator old = i++; + (*old)->destroy(); + } } };