From af8349508d7d7d1452f8ce161dc9c6bf7bd0e34a Mon Sep 17 00:00:00 2001
From: Emilie Wernert <emilie.harquel@ihu-strasbourg.eu>
Date: Thu, 28 Nov 2019 10:17:56 +0100
Subject: [PATCH] fix(SMesh): fix recursive read lock

Update `::visuOgreAdaptor::SMesh` to remove a read lock in an internal method and only call it in the slots.
---
 Bundles/visu/visuOgreAdaptor/src/visuOgreAdaptor/SMesh.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Bundles/visu/visuOgreAdaptor/src/visuOgreAdaptor/SMesh.cpp b/Bundles/visu/visuOgreAdaptor/src/visuOgreAdaptor/SMesh.cpp
index 2cfa3aac959..1fe0b47c7de 100644
--- a/Bundles/visu/visuOgreAdaptor/src/visuOgreAdaptor/SMesh.cpp
+++ b/Bundles/visu/visuOgreAdaptor/src/visuOgreAdaptor/SMesh.cpp
@@ -203,6 +203,8 @@ void SMesh::starting()
     }
 
     ::fwData::Mesh::sptr mesh = this->getInOut< ::fwData::Mesh >(s_MESH_INOUT);
+    ::fwData::mt::ObjectReadLock lock(mesh);
+
     this->updateMesh(mesh);
 }
 
@@ -257,8 +259,6 @@ void SMesh::updateMesh(const ::fwData::Mesh::sptr& _mesh)
     ::Ogre::SceneManager* sceneMgr = this->getSceneManager();
     SLM_ASSERT("::Ogre::SceneManager is null", sceneMgr);
 
-    ::fwData::mt::ObjectReadLock lock(_mesh);
-
     const size_t uiNumVertices = _mesh->getNumberOfPoints();
     if(uiNumVertices == 0)
     {
-- 
GitLab