fixed crash on exit on windows

This commit is contained in:
SVN User
2008-07-29 04:35:26 +00:00
parent ffaa95d79b
commit 9fda26cbc0
3 changed files with 17 additions and 9 deletions
+1 -1
View File
@@ -1 +1 @@
#define BUILD_NUM 424 #define BUILD_NUM 426
+7
View File
@@ -1,3 +1,10 @@
2008-07-28 <vadim@vk.crocodile.org>
* ObjectManipulator.cpp (ObjectManipulator::removeLib): fixed
crash that happened upon exit on some platforms. Need to break
away from the loop after lists were modified because iterators
become undefined.
2008-07-28 Vadim Kurland <vadim@vk.crocodile.org> 2008-07-28 Vadim Kurland <vadim@vk.crocodile.org>
* New application icon * New application icon
+9 -8
View File
@@ -654,7 +654,13 @@ void ObjectManipulator::clearObjects()
int N = m_objectManipulator->libs->count(); int N = m_objectManipulator->libs->count();
if (fwbdebug) qDebug("ObjectManipulator::clearObjects %d libs", N); if (fwbdebug)
{
qDebug("ObjectManipulator::clearObjects %d libs, "
"idxToLibs size: %d, idxToTrees size: %d", N,
int(idxToLibs.size()),
int(idxToTrees.size()));
}
for (int i=N-1; i>=0; i--) for (int i=N-1; i>=0; i--)
{ {
@@ -662,17 +668,11 @@ void ObjectManipulator::clearObjects()
assert(otv!=NULL); assert(otv!=NULL);
m_objectManipulator->widgetStack->removeWidget( otv ); m_objectManipulator->widgetStack->removeWidget( otv );
// delete otv; // delete otv;
removeLib(i); removeLib(i);
} }
if (fwbdebug) qDebug("ObjectManipulator::clearObjects idxToLibs size: %d",
int(idxToLibs.size()));
if (fwbdebug) qDebug("ObjectManipulator::clearObjects idxToTrees size: %d",
int(idxToTrees.size()));
idxToLibs.clear(); idxToLibs.clear();
idxToTrees.clear(); idxToTrees.clear();
m_objectManipulator->libs->clear(); m_objectManipulator->libs->clear();
if (fwbdebug) qDebug("ObjectManipulator::clearObjects done"); if (fwbdebug) qDebug("ObjectManipulator::clearObjects done");
@@ -863,6 +863,7 @@ void ObjectManipulator::removeLib(int id)
m_objectManipulator->libs->removeItem( idx ); m_objectManipulator->libs->removeItem( idx );
idxToLibs.erase(i1); idxToLibs.erase(i1);
idxToTrees.erase(i2); idxToTrees.erase(i2);
break;
} }
} }
} }