diff Python/pythonrun.c @ 28720:03af46d1ac28 legacy-trunk

PyGILState cleanup was too early - destructors called via module cleanup may use the API.
author Mark Hammond <mhammond@skippinet.com.au>
date Tue, 22 Apr 2003 11:18:00 +0000
parents aef01a076ef9
children 72cbc41ccc2f
line wrap: on
line diff
--- a/Python/pythonrun.c	Tue Apr 22 11:05:57 2003 +0000
+++ b/Python/pythonrun.c	Tue Apr 22 11:18:00 2003 +0000
@@ -254,11 +254,6 @@
 	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 @@
 	*/
 	_PyExc_Fini();
 
+	/* Cleanup auto-thread-state */
+#ifdef WITH_THREAD
+	_PyGILState_Fini();
+#endif /* WITH_THREAD */
+
 	/* Clear interpreter state */
 	PyInterpreterState_Clear(interp);