소스 검색
ctkAbstractPythonManager: revert change to clean up PythonQt before finalizing the Python interpreter
This commit reverts 77a24f217d3ef65586107dded4d1df76e36049bf.
The original change worked in conjunction with fixes in PythonQt to avoid
various crashes while destroying the ctkAbstractPythonManager, for example by
calling Py_DECREF after the Python interpreter was finalized.
Further testing shows that a better fix is indeed to finalize first to ensure
clean destruction of PythonQt objects, and to make PythonQt's clean up step more
robust by handling a finalized interpreter.
An example of code which necessitates this change is creating an instance of
class Foo:
class Foo(object):
def __init__(self):
self.timer = qt.QTimer()
def __del__(self):
self.timer.setSingleShot(True)
During Py_Finalize(), the Foo instance's __del__ method is called, which in turn
calls a method on a Qt object. For this to succeed, PythonQt's data must still
be in place.