Fix disconnecting tab signals

This commit is contained in:
Florian Bruhin 2014-07-16 14:11:28 +02:00
parent 1a1473a18e
commit 5e06d420f9

View File

@ -352,12 +352,15 @@ class WebView(QWebView):
callback: Function to call after shutting down.
"""
self._shutdown_callback = callback
# Avoid loading finished signal when stopping
try:
# Avoid loading finished signal when stopping
self.loadFinished.disconnect()
except TypeError:
pass
try:
self.page().mainFrame().loadFinished.disconnect()
except TypeError:
log.destroy.exception("This should never happen.")
pass
self.stop()
self.close()
self.settings().setAttribute(QWebSettings.JavascriptEnabled, False)