-
- Downloads
[ROOT-9809] Only invoke Python C API if Python is initialized
If libPyROOT is loaded with gSystem->Load, the static initialization block in TMemoryRegulator.cxx is executed and ends up invoking PyCFunction_New, which causes a crash from Python 3.7. The crash is due to Python not being initialized. This also happens when using TPython from C++, since Python has not been initialized when TPython is used. Note that when loading libPyROOT from ROOT.py, which is what happens when someone uses PyROOT, the Python interpreter already exists and is initialized, so invoking PyCFunction_New does not crash. This fix moves the creation of gObjectEraseCallback away from the static block in TMemoryRegulator in order to prevent the issue described above.
Please register or sign in to comment