mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-17 08:22:53 +00:00
Fix dirtyChunksLock scope in updateDirtyChunks
Move unique_lock declaration before the FRAME_PROFILE_SCOPE block so it remains in scope for the unlock() calls in the #if/#else branches below.
This commit is contained in:
parent
f1df21590b
commit
57e4bdd973
|
|
@ -1698,6 +1698,7 @@ bool LevelRenderer::updateDirtyChunks() {
|
|||
ClipChunk* nearChunk = nullptr; // Nearest chunk that is dirty
|
||||
int veryNearCount = 0;
|
||||
int minDistSq = 0x7fffffff; // Distances to this chunk
|
||||
std::unique_lock<std::mutex> dirtyChunksLock(m_csDirtyChunks);
|
||||
|
||||
// Set a flag if we should only rebuild existing chunks, not create anything
|
||||
// new
|
||||
|
|
@ -1716,7 +1717,6 @@ bool LevelRenderer::updateDirtyChunks() {
|
|||
PIXAddNamedCounter(((float)memAlloc) / (1024.0f * 1024.0f),
|
||||
"Command buffer allocations");
|
||||
bool onlyRebuild = (memAlloc >= MAX_COMMANDBUFFER_ALLOCATIONS);
|
||||
std::unique_lock<std::mutex> dirtyChunksLock(m_csDirtyChunks);
|
||||
|
||||
// Move any dirty chunks stored in the lock free stack into global flags
|
||||
int index = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue