mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 11:53:34 +02:00
various particle crash and deadlock fixes
This commit is contained in:
parent
0285fe51e8
commit
fd47602945
4 changed files with 4 additions and 7 deletions
interface/src
libraries
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -487,7 +487,9 @@ void ParticleTree::update() {
|
|||
}
|
||||
|
||||
// prune the tree...
|
||||
lockForWrite();
|
||||
recurseTreeWithOperation(pruneOperation, NULL);
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue