Hello,
I have two files, Foo_1.C
and Foo_2.C
, which contain a class definition w/ same name (Foo
), but different initializers for their data members.
Then, in a python steering file (steering.py
) I load the classes sequentially in cling as interpreted macros, and use another interpreted macro (printBar.C
) to perform operations w/ the class members. In my simple example, this just prints the value of the data member bar
of the Foo
instance in question.
At the end of one iteration, I unload the macros using ROOT.gROOT.ProcessLine(".U ...")
.
What I observe is that the bar
value that gets printed is always the one of the first class that’s been loaded in cling. It looks like despite the class being unloaded, cling doesn’t free stuff in memory as one would expect…
Can you tell me what is wrong with this workflow, and what suggestions you might have to make this work?
I attach the set of files for a minimal working example.
Many thanks in advance for the help.
Cheers, Marco
Foo_2.C (62 Bytes)
Foo_1.C (62 Bytes)
printBar.C (122 Bytes)
steering.py (272 Bytes)
ROOT Version: 6.14/06
Platform: Not Provided
Compiler: Not Provided