Skip to content

Commit a34894e

Browse files
authored
No StMaker functions if no StMaker loaded (#693)
In ROOT6, it isn't enough to just hide a class's functions inside an `if` clause checking the corresponding TClass's existence when the class isn't loaded. This can be demonstrated currently in SL24x by simply executing: ``` root4star -b -l -q ``` ...which produces an error when executing `rootlogoff.C` at quit. Maybe there are other solutions, but this simple proposal breaks `rootlogoff.C` into two parts, not even loading the second part unless the first part is true - test the existence of the StMaker class - execution of StMaker functions I welcome other proposals.
1 parent 3271996 commit a34894e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

StRoot/macros/rootlogoff.C

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
if (TClassTable::GetDict("StMaker"))
33
{
4-
StMaker* mk = StMaker::GetChain();
5-
if (mk) {
6-
mk->Finish();
7-
}
4+
gROOT->Macro("rootlogoff2.C");
85
}
96

107
std::cout << "\nThis is the end of STAR ROOT -- Goodbye\n" << std::endl;

StRoot/macros/rootlogoff2.C

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
StMaker* mk = StMaker::GetChain();
3+
if (mk) {
4+
mk->Finish();
5+
}
6+
}

0 commit comments

Comments
 (0)