I am in the process of upgrading our software from ROOT5 to ROOT6 and there is something which works in ROOT5 and not ROOT6 which I cannot currently get around. For various reasons we have some code which within a single python instance will compile a ROOT macro, call the function inside the macro (called “make_plots”), and then compile another macro and run the function in the second macro (which is also called “make_plots”).
I broke this down into the simplest possible example which looks like this:
import ROOT
from ROOT import gSystem, gROOT, TFile
gSystem.CompileMacro("macro1.cc", "f", "macro1.cc")
ROOT.make_plots()
gSystem.Unload("macro1.cc.so")
del ROOT.make_plots
gSystem.CompileMacro("macro2.cc", "f", "macro2.cc")
ROOT.make_plots()
gSystem.Unload("macro2.cc.so")
del ROOT.make_plots
When the above code is run it seg faults on the second call to ROOT.make_plots(). In this simple example all the make_plots() functions in the macros actually do is print something to screen. This works fine with ROOT5.
Any insights into what I might be able to do to do get pyROOT to correctly clean up the first instance of make_plots()?