ImageEngine/cortex — pull request #368 by johnhaddon (2014-12-10 14:00:53+00:00)
Title: Fixed GILReleasePtr crash.

The crashes were observed at shutdown when running the GafferUI test cases. It seemed that some python objects were being destroyed _after_ python had shutdown, and the GILReleasePtr was therefore doing a ScopedGILRelease when python was finalized (or thought it was, despite there still being objects alive) - this lead to errors about NULL thread states. The Py_IsInitialized() call is used to detect this case, and prevents the crash.