mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Check for deletion before emitting signal to avoid runtime error when aborting with interrupt
This commit is contained in:
parent
78fae037c9
commit
5279a3b5cd
@ -15,10 +15,11 @@ from html5_parser import parse
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from itertools import count, repeat
|
from itertools import count, repeat
|
||||||
from qt.core import (
|
from qt.core import (
|
||||||
QApplication, QMarginsF, QObject, QPageLayout, Qt, QTimer, QUrl, pyqtSignal
|
QApplication, QMarginsF, QObject, QPageLayout, Qt, QTimer, QUrl, pyqtSignal, sip
|
||||||
|
)
|
||||||
|
from qt.webengine import (
|
||||||
|
QWebEnginePage, QWebEngineProfile, QWebEngineUrlRequestInterceptor
|
||||||
)
|
)
|
||||||
from qt.webengine import QWebEngineUrlRequestInterceptor
|
|
||||||
from qt.webengine import QWebEnginePage, QWebEngineProfile
|
|
||||||
|
|
||||||
from calibre import detect_ncpus, human_readable, prepare_string_for_xml
|
from calibre import detect_ncpus, human_readable, prepare_string_for_xml
|
||||||
from calibre.constants import __version__, iswindows
|
from calibre.constants import __version__, iswindows
|
||||||
@ -226,6 +227,7 @@ class Renderer(QWebEnginePage):
|
|||||||
|
|
||||||
def printing_done(self, pdf_data):
|
def printing_done(self, pdf_data):
|
||||||
self.working = False
|
self.working = False
|
||||||
|
if not sip.isdeleted(self):
|
||||||
self.work_done.emit(self, bytes(pdf_data))
|
self.work_done.emit(self, bytes(pdf_data))
|
||||||
|
|
||||||
def convert_html_file(self, path, page_layout, settle_time=0, wait_for_title=None):
|
def convert_html_file(self, path, page_layout, settle_time=0, wait_for_title=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user