mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix crash on exit if any plugins have loaded code that raises exceptions during shutdown. Fixes #1592414 [Crash on quit (v2.57.1, OS X El Capitan)](https://bugs.launchpad.net/calibre/+bug/1592414)
This commit is contained in:
parent
92937a12da
commit
2929ba8686
@ -941,7 +941,15 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
pass
|
||||
self.hide_windows()
|
||||
# Do not report any errors that happen after the shutdown
|
||||
sys.excepthook = sys.__excepthook__
|
||||
# We cannot restore the original excepthook as that causes PyQt to
|
||||
# call abort() on unhandled exceptions
|
||||
import traceback
|
||||
def eh(t, v, tb):
|
||||
try:
|
||||
traceback.print_exception(t, v, tb, file=sys.stderr)
|
||||
except:
|
||||
pass
|
||||
sys.excepthook = eh
|
||||
if self._spare_pool is not None:
|
||||
self._spare_pool.shutdown()
|
||||
from calibre.db.delete_service import shutdown
|
||||
|
Loading…
x
Reference in New Issue
Block a user