Segfault in Batch Mode: ROOT.gROOT.SetBatch(True)

That would be true if this was pure Python, but del doesn’t work with all objects in PyROOT. The answer seems to be to still use the destructor, but to use it correctly (which I was not doing). :frowning:

A demonstration is probably better than me trying to write in words:

# on lxplus
$ python
>>> import ROOT
>>> c1 = ROOT.TCanvas()
>>> c1.Destructor()
>>> c1
<ROOT.TCanvas object ("c1_n2") at 0x3b70890>
# c1 hasn't been cleaned up properly!
>>> c2 = ROOT.TCanvas()
>>> c2.IsA().Destructor(c2)
>>> c2
None
# c2 has been cleaned up safely

I am sorry to have wasted your time looking at this, as this was my code’s fault, not ROOT’s. I really appreciate your patience and assistance here.