Skip to content

Commit dd25437

Browse files
authored
Don't kill the WebView on aboutToQuit (#4174)
Webview: Destroy on app.lastWindowClosed - Don't kill the WebView on aboutToQuit Turns out, PyQt5's implementation of QApplication emits that signal every time the user types anything on the input line, when running Python interactively.
1 parent 98ab380 commit dd25437

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/classes/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def get_settings(self):
309309
def show_errors(self):
310310
count = len(self.errors)
311311
if count > 0:
312-
self.log.warning("Displaying {} startup messages".format(count))
312+
self.log.warning("Displaying %d startup messages", count)
313313
while self.errors:
314314
error = self.errors.pop(0)
315315
error.show()
@@ -320,6 +320,7 @@ def _tr(self, message):
320320
@pyqtSlot()
321321
def cleanup(self):
322322
"""aboutToQuit signal handler for application exit"""
323+
self.log.debug("Saving settings in app.cleanup")
323324
try:
324325
self.settings.save()
325326
except Exception:

src/windows/views/webview.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3209,7 +3209,8 @@ def __init__(self, window):
32093209
# Connect shutdown signals
32103210
app.aboutToQuit.connect(self.redraw_audio_timer.stop)
32113211
app.aboutToQuit.connect(self.cache_renderer.stop)
3212-
app.aboutToQuit.connect(self.deleteLater)
3212+
app.lastWindowClosed.connect(self.deleteLater)
32133213

32143214
# Delay the start of cache rendering
32153215
QTimer.singleShot(1500, self.cache_renderer.start)
3216+

0 commit comments

Comments
 (0)