Fix crash when closing tabs on Qt 5.2.1 (Trusty)

This issue was introduced in 8f1d81a644.
This commit is contained in:
Florian Bruhin 2015-02-19 22:20:39 +01:00
parent b5d3b264e8
commit 87951ee3a8

View File

@ -368,7 +368,15 @@ class BrowserPage(QWebPage):
frame: The QWebFrame which gets saved.
item: The QWebHistoryItem to be saved.
"""
if frame != self.mainFrame():
try:
if frame != self.mainFrame():
return
except RuntimeError:
# With Qt 5.2.1 (Ubuntu Trusty) we get this when closing a tab:
# RuntimeError: wrapped C/C++ object of type BrowserPage has
# been deleted
# Since the information here isn't that important for closing
# webviews anyways, we ignore this error.
return
data = {
'zoom': frame.zoomFactor(),