aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Henry <nusmuk@users.sourceforge.net>2007-06-22 16:14:17 +0000
committerCyrille Henry <nusmuk@users.sourceforge.net>2007-06-22 16:14:17 +0000
commit59de77ca8785614dbb461763923f12a22986288e (patch)
tree5e79571ae1e2eb9cc89b2aa41974c2e89fa57459
parentcf6af5786aad94fbd270763b8b067a898399da11 (diff)
add thomas fix for link destruction bug.
svn path=/trunk/externals/nusmuk/; revision=7795
-rw-r--r--msd.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/msd.h b/msd.h
index e4046a2..88bd6ce 100644
--- a/msd.h
+++ b/msd.h
@@ -596,14 +596,18 @@ protected:
return;
}
- t_mass *m = mass.find(GetAInt(argv[0]));
- if(m) {
- // Delete all associated links
- for(typename std::vector<t_link *>::iterator it = m->links.begin(); it < m->links.end(); ++it)
- deletelink(*it);
- outmass(S_Mass_deleted,m);
- massids.erase(m);
- mass.remove(m->nbr);
+
+ t_mass *m = mass.find(GetAInt(argv[0]));
+ if(m) {
+ // Delete all associated links
+
+ while(!m->links.empty())
+ deletelink(m->links.front());
+
+ outmass(S_Mass_deleted,m);
+ massids.erase(m);
+ mass.remove(m->nbr);
+
delete m;
mass_deleted = 1;
}