Skip to content
Snippets Groups Projects
Commit 31ca8b15 authored by Andrei Gheata's avatar Andrei Gheata
Browse files

Fix deadlock in TGeoBranchArray

git-svn-id: http://root.cern.ch/svn/root/trunk@41572 27541ba8-7e3a-0410-8455-c3a389f83636
parent 84c5279a
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,7 @@ TGeoBranchArray& TGeoBranchArray::operator=(const TGeoBranchArray& other) ...@@ -69,6 +69,7 @@ TGeoBranchArray& TGeoBranchArray::operator=(const TGeoBranchArray& other)
{ {
// Assignment. // Assignment.
if (&other == this) return *this; if (&other == this) return *this;
TThread::Lock();
fLevel = other.fLevel; fLevel = other.fLevel;
if (fLevel) fArray = new UShort_t[fLevel]; if (fLevel) fArray = new UShort_t[fLevel];
if (other.fMatrix) { if (other.fMatrix) {
...@@ -76,6 +77,7 @@ TGeoBranchArray& TGeoBranchArray::operator=(const TGeoBranchArray& other) ...@@ -76,6 +77,7 @@ TGeoBranchArray& TGeoBranchArray::operator=(const TGeoBranchArray& other)
fMatrix->CopyFrom(other.fMatrix); fMatrix->CopyFrom(other.fMatrix);
} }
fClient = other.fClient; fClient = other.fClient;
TThread::UnLock();
return *this; return *this;
} }
...@@ -217,6 +219,7 @@ void TGeoBranchArray::InitFromNavigator(TGeoNavigator *nav) ...@@ -217,6 +219,7 @@ void TGeoBranchArray::InitFromNavigator(TGeoNavigator *nav)
if (!level) { if (!level) {
// delete [] fArray; fArray = 0; // delete [] fArray; fArray = 0;
fLevel = 0; fLevel = 0;
TThread::UnLock();
return; return;
} }
if (!fArray || level>fLevel) { if (!fArray || level>fLevel) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment