]> granicus.if.org Git - python/commitdiff
Fix _PyFaulthandler_Fini() so it can be called before _PyFaulthandler_Init()
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 10 Jan 2012 21:44:11 +0000 (22:44 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 10 Jan 2012 21:44:11 +0000 (22:44 +0100)
Modules/faulthandler.c

index 51c66bdd659ffd88c3a621eba5e21b5ad9b8aed1..fcf4d0123910cd25a4b059ffb567f458832588cb 100644 (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;