Fix _PyFaulthandler_Fini() so it can be called before _PyFaulthandler_Init()

This commit is contained in:
Victor Stinner 2012-01-10 22:44:11 +01:00
parent 76961faaa0
commit 1134b0dbbd
1 changed files with 2 additions and 2 deletions

View File

@ -1282,8 +1282,8 @@ void _PyFaulthandler_Fini(void)
#ifdef FAULTHANDLER_LATER
/* later */
cancel_dump_tracebacks_later();
if (thread.cancel_event) {
cancel_dump_tracebacks_later();
PyThread_release_lock(thread.cancel_event);
PyThread_free_lock(thread.cancel_event);
thread.cancel_event = NULL;
@ -1296,8 +1296,8 @@ void _PyFaulthandler_Fini(void)
#ifdef FAULTHANDLER_WATCHDOG
/* file watchdog */
cancel_file_watchdog();
if (watchdog.cancel_event) {
cancel_file_watchdog();
PyThread_release_lock(watchdog.cancel_event);
PyThread_free_lock(watchdog.cancel_event);
watchdog.cancel_event = NULL;