diff options
author | Cyrille Henry <nusmuk@users.sourceforge.net> | 2007-06-22 16:14:17 +0000 |
---|---|---|
committer | Cyrille Henry <nusmuk@users.sourceforge.net> | 2007-06-22 16:14:17 +0000 |
commit | 59de77ca8785614dbb461763923f12a22986288e (patch) | |
tree | 5e79571ae1e2eb9cc89b2aa41974c2e89fa57459 | |
parent | cf6af5786aad94fbd270763b8b067a898399da11 (diff) |
add thomas fix for link destruction bug.
svn path=/trunk/externals/nusmuk/; revision=7795
-rw-r--r-- | msd.h | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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; } |