mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 13:15:15 +02:00
lock on the solo voxelServer before deleting local voxels
This commit is contained in:
parent
6b83f95f9e
commit
6c2682833e
1 changed files with 15 additions and 1 deletions
|
@ -1140,10 +1140,24 @@ void Application::editPreferences() {
|
|||
return;
|
||||
}
|
||||
|
||||
// check if the domain server hostname is new - if so we need to clear the nodelist and delete the local voxels
|
||||
|
||||
const char* newHostname = domainServerHostname->text().toLocal8Bit().data();
|
||||
|
||||
// check if the domain server hostname is new
|
||||
if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, sizeof(&newHostname)) != 0) {
|
||||
// if so we need to clear the nodelist and delete the local voxels
|
||||
Node *voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);
|
||||
|
||||
if (voxelServer) {
|
||||
voxelServer->lock();
|
||||
}
|
||||
|
||||
_voxels.killLocalVoxels();
|
||||
|
||||
if (voxelServer) {
|
||||
voxelServer->unlock();
|
||||
}
|
||||
|
||||
NodeList::getInstance()->clear();
|
||||
NodeList::getInstance()->setDomainHostname(newHostname);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue