diff --git a/.gitignore b/.gitignore index 0065262e93d91..631ff0fbb1425 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,9 @@ etc/allDict.h xcuserdata project.xcworkspace +# MacOS metadata +.DS_Store + # Visual Code .vscode/* diff --git a/hist/hist/src/TH1Merger.cxx b/hist/hist/src/TH1Merger.cxx index ce4076b776e6a..92c78a57d9f1c 100644 --- a/hist/hist/src/TH1Merger.cxx +++ b/hist/hist/src/TH1Merger.cxx @@ -384,13 +384,13 @@ Bool_t TH1Merger::BufferMerge() { } if (fH0->fDimension == 2) { auto h2 = dynamic_cast(fH0); - R__ASSERT(h2); + R__ASSERT(h2); for (Int_t i = 0; i < nbentries; i++) h2->Fill(hist->fBuffer[3*i + 2], hist->fBuffer[3*i + 3],hist->fBuffer[3*i + 1] ); } if (fH0->fDimension == 3) { auto h3 = dynamic_cast(fH0); - R__ASSERT(h3); + R__ASSERT(h3); for (Int_t i = 0; i < nbentries; i++) h3->Fill(hist->fBuffer[4*i + 2], hist->fBuffer[4*i + 3],hist->fBuffer[4*i + 4], hist->fBuffer[4*i + 1] ); } diff --git a/math/mathmore/src/GSLMultiFitFunctionWrapper.h b/math/mathmore/src/GSLMultiFitFunctionWrapper.h index d3639bf4d2886..833f1a7801723 100644 --- a/math/mathmore/src/GSLMultiFitFunctionWrapper.h +++ b/math/mathmore/src/GSLMultiFitFunctionWrapper.h @@ -67,6 +67,8 @@ class GSLMultiFitFunctionWrapper { fFunc.n = 0; fFunc.p = 0; fFunc.params = 0; + fFunc.nevalf = 0; + fFunc.nevaldf = 0; } diff --git a/math/mathmore/test/testDerivation.cxx b/math/mathmore/test/testDerivation.cxx index 591060d5e27d2..1788d59dc37c2 100644 --- a/math/mathmore/test/testDerivation.cxx +++ b/math/mathmore/test/testDerivation.cxx @@ -118,7 +118,8 @@ int testDerivation() { // WrappedFunc fy(*f2d,0,vx); // std::cout << "df/dy = " << der->EvalCentral(fy,2.) << std::endl; // #endif - + delete der; //fix memory leak + der = nullptr; return status; } diff --git a/math/mathmore/test/testGSLRootFinder.cxx b/math/mathmore/test/testGSLRootFinder.cxx index cb8bb343f150f..b79fc3e34a4bf 100644 --- a/math/mathmore/test/testGSLRootFinder.cxx +++ b/math/mathmore/test/testGSLRootFinder.cxx @@ -167,9 +167,15 @@ int testGSLRootFinder() { } timer.Stop(); status += printStats(rf6, returnCode, timer); - + delete rf1; + rf1 = nullptr; + delete rf2; + rf2 = nullptr; + delete rf3; + rf3 = nullptr; + delete rf4; + rf4 = nullptr; return status; - } int main() { diff --git a/math/mathmore/test/testInterpolation.cxx b/math/mathmore/test/testInterpolation.cxx index 5abcc586e975c..920bdfb7c9c17 100644 --- a/math/mathmore/test/testInterpolation.cxx +++ b/math/mathmore/test/testInterpolation.cxx @@ -29,10 +29,14 @@ void interpolate( const ROOT::Math::Interpolator & itp, bool drawSame = false ) std::cout << "x[i] y[i] deriv[i] deriv2[i] integral[i] \n" << std::endl; // print result of interpolation - const Int_t n = 51; + const Int_t n = 50; //JH replacing n = 51; Int_t i = 0; + double xi = 0.; Float_t xcoord[n], ycoord[n]; - for ( double xi = 0; xi < 10.01; xi += 0.2) { + + for ( i = 0; i < 50; ++i) { + xi = 0.2 * i; + // JH replacing for ( double xi = 0; xi < 10.01; xi += 0.2) { xcoord[i] = xi; ycoord[i] = itp.Eval(xi); double dyi = itp.Deriv(xi); diff --git a/test/TFormulaTests.cxx b/test/TFormulaTests.cxx index ca4fd1d18d688..a42b041027dd3 100644 --- a/test/TFormulaTests.cxx +++ b/test/TFormulaTests.cxx @@ -184,6 +184,7 @@ Bool_t TFormulaTests::SetVars() successful = false; } } + delete[] vars; return successful; } diff --git a/test/stressHistogram.cxx b/test/stressHistogram.cxx index 1979016864210..eb7307e2ea514 100644 --- a/test/stressHistogram.cxx +++ b/test/stressHistogram.cxx @@ -10243,6 +10243,10 @@ int stressHistogram() << gROOT->GetGitBranch() << "@" << gROOT->GetGitCommit() << std::endl; std::cout <<"****************************************************************************\n"; + if (cleanHistos) { + delete ht2; + delete htp2; + } return GlobalStatus; } diff --git a/test/stressTMVA.cxx b/test/stressTMVA.cxx index 268fb461d74ad..bde8f16af3552 100644 --- a/test/stressTMVA.cxx +++ b/test/stressTMVA.cxx @@ -1583,8 +1583,10 @@ bool utFactory::addEventsToFactoryByHand(const char* factoryname, const char* op factory->TrainAllMethods(); factory->TestAllMethods(); factory->EvaluateAllMethods(); - MethodBase* theMethod = dynamic_cast (factory->GetMethod(dataloader->GetName(), _methodTitle)); - double ROCValue = theMethod->GetROCIntegral(); + double ROCValue(0.); + if (auto theMethod = dynamic_cast(factory->GetMethod(dataloader->GetName(), _methodTitle))) { + ROCValue = theMethod->GetROCIntegral(); + } //cout << "ROC="<TrainAllMethods(); factory->TestAllMethods(); factory->EvaluateAllMethods(); - MethodBase* theMethod = dynamic_cast (factory->GetMethod(dataloader->GetName(), _methodTitle)); - double ROCValue = theMethod->GetROCIntegral(); + double ROCValue(0.); + if (auto theMethod = dynamic_cast(factory->GetMethod(dataloader->GetName(), _methodTitle))) { + ROCValue = theMethod->GetROCIntegral(); + } delete tree; delete dataloader; delete factory; diff --git a/tmva/tmvagui/src/rulevisHists.cxx b/tmva/tmvagui/src/rulevisHists.cxx index d397e7c10594f..1edd521d1143d 100644 --- a/tmva/tmvagui/src/rulevisHists.cxx +++ b/tmva/tmvagui/src/rulevisHists.cxx @@ -174,6 +174,7 @@ void TMVA::rulevisHists( TDirectory *rfdir, TDirectory *vardir, TDirectory *corr if (bgd == NULL) { cout << "ERROR!!! couldn't find backgroung histo for" << hname << endl; //exit(1); + delete [] c; return; }