[TMVA] Throw an exception when input file for using RBDT does not exist.#9499
[TMVA] Throw an exception when input file for using RBDT does not exist.#9499lmoneta merged 2 commits intoroot-project:masterfrom
Conversation
|
Starting build on |
|
Build failed on mac11/cxx17. Failing tests: |
|
Build failed on mac1015/python3. Failing tests: |
tmva/tmva/inc/TMVA/RBDT.hxx
Outdated
| { | ||
| // Get number of output nodes of the forest | ||
| auto file = TFile::Open(filename.c_str(), "READ"); | ||
| if (!file) { |
There was a problem hiding this comment.
| if (!file) { | |
| if (!file || file->IsZombie()) { |
tmva/tmva/inc/TMVA/RBDT.hxx
Outdated
| @@ -48,6 +48,9 @@ public: | |||
| { | |||
| // Get number of output nodes of the forest | |||
| auto file = TFile::Open(filename.c_str(), "READ"); | |||
There was a problem hiding this comment.
is the file leaked?
| auto file = TFile::Open(filename.c_str(), "READ"); | |
| std::unique_ptr<TFile> file{TFile::Open(filename.c_str())}; |
There was a problem hiding this comment.
Yes, correct. It was only closed but not deleted the file ! Thanks for finding this!
|
Starting build on |
eguiraud
left a comment
There was a problem hiding this comment.
LGTM. GetObjectSafe is type-unsafe, but that's for another PR 😄
This PR fixes #9316