]> granicus.if.org Git - python/commitdiff
PyGILState cleanup was too early - destructors called via module cleanup may use...
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 22 Apr 2003 11:18:00 +0000 (11:18 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Tue, 22 Apr 2003 11:18:00 +0000 (11:18 +0000)
Python/pythonrun.c

index e5759b7eece9942c42ea1e8d44fcb69ea9581587..a8dedde7c11d877b2f93df684d0210d0c1094a6b 100644 (file)
@@ -254,11 +254,6 @@ Py_Finalize(void)
        call_sys_exitfunc();
        initialized = 0;
 
-       /* Cleanup auto-thread-state */
-#ifdef WITH_THREAD
-       _PyGILState_Fini();
-#endif /* WITH_THREAD */
-
        /* Get current thread state and interpreter pointer */
        tstate = PyThreadState_Get();
        interp = tstate->interp;
@@ -310,6 +305,11 @@ Py_Finalize(void)
        */
        _PyExc_Fini();
 
+       /* Cleanup auto-thread-state */
+#ifdef WITH_THREAD
+       _PyGILState_Fini();
+#endif /* WITH_THREAD */
+
        /* Clear interpreter state */
        PyInterpreterState_Clear(interp);