aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kvilib/core/kvi_pointerhashtable.h6
-rw-r--r--src/kvilib/ext/kvi_sharedfiles.cpp11
2 files changed, 11 insertions, 6 deletions
diff --git a/src/kvilib/core/kvi_pointerhashtable.h b/src/kvilib/core/kvi_pointerhashtable.h
index 7a93251d2..06b3911a6 100644
--- a/src/kvilib/core/kvi_pointerhashtable.h
+++ b/src/kvilib/core/kvi_pointerhashtable.h
@@ -725,8 +725,8 @@ public:
m_bAutoDelete = true;
m_bDeepCopyKeys = bDeepCopyKeys;
m_uSize = uSize > 0 ? uSize : 32;
- m_pDataArray = new KviPointerList<KviPointerHashTableEntry<Key,T> > *[uSize];
- for(unsigned int i=0;i<m_uSize;i++)m_pDataArray[i] = 0;
+ m_pDataArray = new KviPointerList<KviPointerHashTableEntry<Key,T> > *[m_uSize];
+ for(unsigned int i=0;i<m_uSize;i++)m_pDataArray[i] = NULL;
}
///
@@ -742,7 +742,7 @@ public:
m_bDeepCopyKeys = t.m_bDeepCopyKeys;
m_uSize = t.m_uSize;
m_pDataArray = new KviPointerList<KviPointerHashTableEntry<Key,T> > *[m_uSize];
- for(unsigned int i=0;i<m_uSize;i++)m_pDataArray[i] = 0;
+ for(unsigned int i=0;i<m_uSize;i++)m_pDataArray[i] = NULL;
copyFrom(t);
}
diff --git a/src/kvilib/ext/kvi_sharedfiles.cpp b/src/kvilib/ext/kvi_sharedfiles.cpp
index 693f24d38..dcb9464ec 100644
--- a/src/kvilib/ext/kvi_sharedfiles.cpp
+++ b/src/kvilib/ext/kvi_sharedfiles.cpp
@@ -124,6 +124,9 @@ void KviSharedFilesManager::cleanup()
bool bOtherStuffToCleanup = false;
//bool bChanged = false;
+ KviPointerList<QString> lDying;
+ lDying.setAutoDelete(true);
+
while(KviSharedFileList * l = it.current())
{
KviPointerList<KviSharedFile> tmp;
@@ -147,12 +150,14 @@ void KviSharedFilesManager::cleanup()
emit sharedFileRemoved(fo);
}
if(l->count() == 0)
- {
- m_pSharedListDict->remove(it.currentKey());
- }
+ lDying.append(new QString(it.currentKey()));
+
++it;
}
+ for(QString * pDyingKey = lDying.first();pDyingKey;pDyingKey = lDying.next())
+ m_pSharedListDict->remove(*pDyingKey);
+
if(!bOtherStuffToCleanup)m_pCleanupTimer->stop();
//if(bChanged)emit sharedFilesChanged();
}