hints: Store id() of destroyed frames.

Fixes #305. #152 should still be okay.
This commit is contained in:
Florian Bruhin 2014-12-12 01:25:04 +01:00
parent decfd02033
commit 841e31283c

View File

@ -58,7 +58,7 @@ class HintContext:
Attributes:
frames: The QWebFrames to use.
destroyed_frames: QWebFrames which have been destroyed.
destroyed_frames: id()'s of QWebFrames which have been destroyed.
(Workaround for https://github.com/The-Compiler/qutebrowser/issues/152)
elems: A mapping from keystrings to (elem, label) namedtuples.
baseurl: The URL of the current page.
@ -148,7 +148,7 @@ class HintManager(QObject):
pass
for f in self._context.frames:
log.hints.debug("Disconnecting frame {}".format(f))
if any(e is f for e in self._context.destroyed_frames):
if id(f) in self._context.destroyed_frames:
# WORKAROUND for
# https://github.com/The-Compiler/qutebrowser/issues/152
log.hints.debug("Frame has been destroyed, ignoring.")
@ -661,7 +661,7 @@ class HintManager(QObject):
# WORKAROUND for
# https://github.com/The-Compiler/qutebrowser/issues/152
frame.destroyed.connect(functools.partial(
self._context.destroyed_frames.append, frame))
self._context.destroyed_frames.append, id(frame)))
self._context.args = args
self._init_elements(mainframe, group)
message_bridge = objreg.get('message-bridge', scope='window',