From 299f68cda6067329c5b092e35cbdfe401ee73264 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 3 Sep 2018 13:16:16 +0200 Subject: [PATCH] add comment about using readLockNormalCache --- src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index 123aa9387b..4c6af98adb 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -577,8 +577,12 @@ void SoFCIndexedFaceSet::drawFaces(SoGLRenderAction *action) drawCoords(static_cast(coords), cindices, numindices, normals, nindices, &mb, mindices, binding, &tb, tindices); - if(normalCacheUsed) + // getVertexData() internally calls readLockNormalCache() that read locks + // the normal cache. When the cache is not needed any more we must call + // readUnlockNormalCache() + if (normalCacheUsed) this->readUnlockNormalCache(); + // Disable caching for this node SoGLCacheContextElement::shouldAutoCache(state, SoGLCacheContextElement::DONT_AUTO_CACHE); #endif @@ -851,7 +855,10 @@ void SoFCIndexedFaceSet::generateGLArrays(SoGLRenderAction * action) render.generateGLArrays(action, matbind, face_vertices, face_indices); - if(normalCacheUsed) + // getVertexData() internally calls readLockNormalCache() that read locks + // the normal cache. When the cache is not needed any more we must call + // readUnlockNormalCache() + if (normalCacheUsed) this->readUnlockNormalCache(); }