possible fix to particle server crashes

This commit is contained in:
ZappoMan 2014-01-22 16:13:37 -08:00
parent 3c5cd850fc
commit cae9bc7a0f
2 changed files with 4 additions and 2 deletions

View file

@ -118,7 +118,7 @@ int ParticleServer::sendSpecialPacket(Node* node) {
void ParticleServer::pruneDeletedParticles() {
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
if (tree->hasAnyDeletedParticles()) {
if (tree && tree->hasAnyDeletedParticles()) {
//qDebug() << "there are some deleted particles to consider...";
uint64_t earliestLastDeletedParticlesSent = usecTimestampNow() + 1; // in the future

View file

@ -398,7 +398,9 @@ void ParticleTree::forgetParticlesDeletedBefore(uint64_t sinceTime) {
//qDebug() << "YES older... time/key:" << iterator.key();
_recentlyDeletedParticleIDs.remove(iterator.key());
}
++iterator;
if (iterator != _recentlyDeletedParticleIDs.constEnd()) {
++iterator;
}
}
_recentlyDeletedParticlesLock.unlock();
}