Use functools instead of a lambda for QTimer

It reads nicer, and this is also speculative fix for #3896 as PyQt5 is
hopefully better at disconnecting partial-objects from dead objects than it is
with lambdas.
This commit is contained in:
Florian Bruhin 2018-05-23 09:44:44 +02:00
parent 26e37739e2
commit 7162f15348

View File

@ -1035,8 +1035,9 @@ class WebEngineTab(browsertab.AbstractTab):
log.config.debug( log.config.debug(
"Loading {} again because of config change".format( "Loading {} again because of config change".format(
self._reload_url.toDisplayString())) self._reload_url.toDisplayString()))
QTimer.singleShot(100, lambda url=self._reload_url: QTimer.singleShot(100, functools.partial(self.openurl,
self.openurl(url, predict=False)) self._reload_url,
predict=False))
self._reload_url = None self._reload_url = None
if not qtutils.version_check('5.10', compiled=False): if not qtutils.version_check('5.10', compiled=False):