mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
set up fault handler
This commit is contained in:
parent
c17b0650b0
commit
9f28d5a638
1 changed files with 10 additions and 0 deletions
10
aqt/main.py
10
aqt/main.py
|
@ -7,6 +7,7 @@ import signal
|
|||
import zipfile
|
||||
import gc
|
||||
import time
|
||||
import faulthandler
|
||||
|
||||
from send2trash import send2trash
|
||||
from aqt.qt import *
|
||||
|
@ -66,6 +67,7 @@ class AnkiQt(QMainWindow):
|
|||
|
||||
def setupUI(self):
|
||||
self.col = None
|
||||
self.setupCrashLog()
|
||||
self.setupAppMsg()
|
||||
self.setupKeys()
|
||||
self.setupThreads()
|
||||
|
@ -1165,6 +1167,14 @@ Please ensure a profile is open and Anki is not busy, then try again."""),
|
|||
def _onCollect(self):
|
||||
gc.collect()
|
||||
|
||||
# Crash log
|
||||
##########################################################################
|
||||
|
||||
def setupCrashLog(self):
|
||||
p = os.path.join(self.pm.base, "crash.log")
|
||||
self._crashLog = open(p, "a")
|
||||
faulthandler.enable(self._crashLog)
|
||||
|
||||
# Media server
|
||||
##########################################################################
|
||||
# prevent malicious decks from accessing the local filesystem
|
||||
|
|
Loading…
Reference in a new issue