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

Fixed double delete when having several geometry managers per session

git-svn-id: http://root.cern.ch/svn/root/trunk@44689 27541ba8-7e3a-0410-8455-c3a389f83636
parent dbf02c60
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ TGeoPatternFinder::ThreadData_t::~ThreadData_t() ...@@ -63,7 +63,7 @@ TGeoPatternFinder::ThreadData_t::~ThreadData_t()
{ {
// Destructor. // Destructor.
if (fMatrix != gGeoIdentity) delete fMatrix; // if (fMatrix != gGeoIdentity) delete fMatrix;
} }
//______________________________________________________________________________ //______________________________________________________________________________
...@@ -317,8 +317,13 @@ void TGeoPatternX::cd(Int_t idiv) ...@@ -317,8 +317,13 @@ void TGeoPatternX::cd(Int_t idiv)
TGeoMatrix* TGeoPatternX::CreateMatrix() const TGeoMatrix* TGeoPatternX::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoTranslation(0.,0.,0.); if (!IsReflected()) {
TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
matrix->RegisterYourself();
return matrix;
}
TGeoCombiTrans *combi = new TGeoCombiTrans(); TGeoCombiTrans *combi = new TGeoCombiTrans();
combi->RegisterYourself();
combi->ReflectZ(kTRUE); combi->ReflectZ(kTRUE);
combi->ReflectZ(kFALSE); combi->ReflectZ(kFALSE);
return combi; return combi;
...@@ -487,11 +492,16 @@ void TGeoPatternY::cd(Int_t idiv) ...@@ -487,11 +492,16 @@ void TGeoPatternY::cd(Int_t idiv)
TGeoMatrix* TGeoPatternY::CreateMatrix() const TGeoMatrix* TGeoPatternY::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoTranslation(0.,0.,0.); if (!IsReflected()) {
TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
matrix->RegisterYourself();
return matrix;
}
TGeoCombiTrans *combi = new TGeoCombiTrans(); TGeoCombiTrans *combi = new TGeoCombiTrans();
combi->RegisterYourself();
combi->ReflectZ(kTRUE); combi->ReflectZ(kTRUE);
combi->ReflectZ(kFALSE); combi->ReflectZ(kFALSE);
return combi; return combi;
} }
//_____________________________________________________________________________ //_____________________________________________________________________________
...@@ -653,8 +663,13 @@ void TGeoPatternZ::cd(Int_t idiv) ...@@ -653,8 +663,13 @@ void TGeoPatternZ::cd(Int_t idiv)
TGeoMatrix* TGeoPatternZ::CreateMatrix() const TGeoMatrix* TGeoPatternZ::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoTranslation(0.,0.,0.); if (!IsReflected()) {
TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
matrix->RegisterYourself();
return matrix;
}
TGeoCombiTrans *combi = new TGeoCombiTrans(); TGeoCombiTrans *combi = new TGeoCombiTrans();
combi->RegisterYourself();
combi->ReflectZ(kTRUE); combi->ReflectZ(kTRUE);
combi->ReflectZ(kFALSE); combi->ReflectZ(kFALSE);
return combi; return combi;
...@@ -879,8 +894,13 @@ void TGeoPatternParaX::SavePrimitive(std::ostream &out, Option_t * /*option*/ /* ...@@ -879,8 +894,13 @@ void TGeoPatternParaX::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*
TGeoMatrix* TGeoPatternParaX::CreateMatrix() const TGeoMatrix* TGeoPatternParaX::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoTranslation(0.,0.,0.); if (!IsReflected()) {
TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
matrix->RegisterYourself();
return matrix;
}
TGeoCombiTrans *combi = new TGeoCombiTrans(); TGeoCombiTrans *combi = new TGeoCombiTrans();
combi->RegisterYourself();
combi->ReflectZ(kTRUE); combi->ReflectZ(kTRUE);
combi->ReflectZ(kFALSE); combi->ReflectZ(kFALSE);
return combi; return combi;
...@@ -1035,8 +1055,13 @@ void TGeoPatternParaY::SavePrimitive(std::ostream &out, Option_t * /*option*/ /* ...@@ -1035,8 +1055,13 @@ void TGeoPatternParaY::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*
TGeoMatrix* TGeoPatternParaY::CreateMatrix() const TGeoMatrix* TGeoPatternParaY::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoTranslation(0.,0.,0.); if (!IsReflected()) {
TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
matrix->RegisterYourself();
return matrix;
}
TGeoCombiTrans *combi = new TGeoCombiTrans(); TGeoCombiTrans *combi = new TGeoCombiTrans();
combi->RegisterYourself();
combi->ReflectZ(kTRUE); combi->ReflectZ(kTRUE);
combi->ReflectZ(kFALSE); combi->ReflectZ(kFALSE);
return combi; return combi;
...@@ -1195,8 +1220,13 @@ void TGeoPatternParaZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /* ...@@ -1195,8 +1220,13 @@ void TGeoPatternParaZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*
TGeoMatrix* TGeoPatternParaZ::CreateMatrix() const TGeoMatrix* TGeoPatternParaZ::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoTranslation(0.,0.,0.); if (!IsReflected()) {
TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
matrix->RegisterYourself();
return matrix;
}
TGeoCombiTrans *combi = new TGeoCombiTrans(); TGeoCombiTrans *combi = new TGeoCombiTrans();
combi->RegisterYourself();
combi->ReflectZ(kTRUE); combi->ReflectZ(kTRUE);
combi->ReflectZ(kFALSE); combi->ReflectZ(kFALSE);
return combi; return combi;
...@@ -1364,8 +1394,13 @@ void TGeoPatternTrapZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /* ...@@ -1364,8 +1394,13 @@ void TGeoPatternTrapZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*
TGeoMatrix* TGeoPatternTrapZ::CreateMatrix() const TGeoMatrix* TGeoPatternTrapZ::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoTranslation(0.,0.,0.); if (!IsReflected()) {
TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
matrix->RegisterYourself();
return matrix;
}
TGeoCombiTrans *combi = new TGeoCombiTrans(); TGeoCombiTrans *combi = new TGeoCombiTrans();
combi->RegisterYourself();
combi->ReflectZ(kTRUE); combi->ReflectZ(kTRUE);
combi->ReflectZ(kFALSE); combi->ReflectZ(kFALSE);
return combi; return combi;
...@@ -1676,8 +1711,13 @@ void TGeoPatternCylPhi::Streamer(TBuffer &R__b) ...@@ -1676,8 +1711,13 @@ void TGeoPatternCylPhi::Streamer(TBuffer &R__b)
TGeoMatrix* TGeoPatternCylPhi::CreateMatrix() const TGeoMatrix* TGeoPatternCylPhi::CreateMatrix() const
{ {
// Return new matrix of type used by this finder. // Return new matrix of type used by this finder.
if (!IsReflected()) return new TGeoRotation(); if (!IsReflected()) {
TGeoRotation *matrix = new TGeoRotation();
matrix->RegisterYourself();
return matrix;
}
TGeoRotation *rot = new TGeoRotation(); TGeoRotation *rot = new TGeoRotation();
rot->RegisterYourself();
rot->ReflectZ(kTRUE); rot->ReflectZ(kTRUE);
rot->ReflectZ(kFALSE); rot->ReflectZ(kFALSE);
return rot; return rot;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment