Import 2017-06-07 23:51:09: master 45d353d7

Author Committer Branch Timestamp Parent
msmolens msmolens master 2015-09-14 16:50:08 master 042c3080
Changeset

ENH: Update CTK to include PythonQt cleanup fixes

Fixes crash on exit in py_nomainwindow_DCMTKPrivateDictTest.

// -------------------------------------------
commit commontk/CTK@ffc7f7a9
Author: Max Smolens <max.smolens@kitware.com>
Date: Fri Sep 11 16:52:23 2015 -0400

ctkAbstractPythonManager: revert change to clean up PythonQt before finalizing the Python interpreter

This commit reverts commontk/CTK@77a24f2

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.

// -------------------------------------------

From: Max Smolens <max.smolens@kitware.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24538 3bd1e089-480b-0410-8dfb-8563597acbee

mod - SuperBuild/External_CTK.cmake Diff File