_voxelFades needs locking.

This commit is contained in:
Kai Ludwig 2014-05-23 20:21:00 +02:00
parent 21b89b9940
commit 107c142532
2 changed files with 11 additions and 0 deletions

View file

@ -2525,6 +2525,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) {
if (_voxelFades.size() > 0) {
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
"Application::displaySide() ... voxel fades...");
_voxelFadesLock.lockForWrite();
for(std::vector<VoxelFade>::iterator fade = _voxelFades.begin(); fade != _voxelFades.end();) {
fade->render();
if(fade->isDone()) {
@ -2533,6 +2534,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) {
++fade;
}
}
_voxelFadesLock.unlock();
}
// give external parties a change to hook in
@ -3188,7 +3190,9 @@ void Application::nodeKilled(SharedNodePointer node) {
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99f;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFadesLock.lockForWrite();
_voxelFades.push_back(fade);
_voxelFadesLock.unlock();
}
// If the voxel server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
@ -3219,7 +3223,9 @@ void Application::nodeKilled(SharedNodePointer node) {
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99f;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFadesLock.lockForWrite();
_voxelFades.push_back(fade);
_voxelFadesLock.unlock();
}
// If the particle server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
@ -3251,7 +3257,9 @@ void Application::nodeKilled(SharedNodePointer node) {
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99f;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFadesLock.lockForWrite();
_voxelFades.push_back(fade);
_voxelFadesLock.unlock();
}
// If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
@ -3336,7 +3344,9 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99f;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFadesLock.lockForWrite();
_voxelFades.push_back(fade);
_voxelFadesLock.unlock();
}
}
// store jurisdiction details for later use

View file

@ -533,6 +533,7 @@ private:
NodeBounds _nodeBoundsDisplay;
std::vector<VoxelFade> _voxelFades;
QReadWriteLock _voxelFadesLock;
ControllerScriptingInterface _controllerScriptingInterface;
QPointer<LogDialog> _logDialog;
QPointer<SnapshotShareDialog> _snapshotShareDialog;