various particle crash and deadlock fixes

This commit is contained in:
ZappoMan 2014-03-03 12:49:34 -08:00
parent 0285fe51e8
commit fd47602945
4 changed files with 4 additions and 7 deletions

View file

@ -33,10 +33,7 @@ void ParticleTreeRenderer::init() {
void ParticleTreeRenderer::update() {
if (_tree) {
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
if (tree->tryLockForWrite()) {
tree->update();
tree->unlock();
}
tree->update();
}
}

View file

@ -739,7 +739,7 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
_externalChildrenMemoryUsage += NUMBER_OF_CHILDREN * sizeof(OctreeElement*);
} else if (previousChildCount == 2 && newChildCount == 1) {
assert(child); // we are removing a child, so this must be true!
assert(!child); // we are removing a child, so this must be true!
OctreeElement* previousFirstChild = _children.external[firstIndex];
OctreeElement* previousSecondChild = _children.external[secondIndex];
delete[] _children.external;

View file

@ -487,7 +487,9 @@ void ParticleTree::update() {
}
// prune the tree...
lockForWrite();
recurseTreeWithOperation(pruneOperation, NULL);
unlock();
}

View file

@ -30,12 +30,10 @@ public:
private slots:
/// inbound slots for external collision systems
void forwardParticleCollisionWithVoxel(const ParticleID& particleID, const VoxelDetail& voxel) {
qDebug() << "forwardParticleCollisionWithVoxel()";
emit particleCollisionWithVoxel(particleID, voxel);
}
void forwardParticleCollisionWithParticle(const ParticleID& idA, const ParticleID& idB) {
qDebug() << "forwardParticleCollisionWithParticle()";
emit particleCollisionWithParticle(idA, idB);
}