Check for deleted window
This commit is contained in:
parent
2fe1a1db89
commit
0540a43995
@ -29,6 +29,7 @@ Module attributes:
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import sip
|
||||||
from PyQt5.QtGui import QFont
|
from PyQt5.QtGui import QFont
|
||||||
from PyQt5.QtWebEngineWidgets import (QWebEngineSettings, QWebEngineProfile,
|
from PyQt5.QtWebEngineWidgets import (QWebEngineSettings, QWebEngineProfile,
|
||||||
QWebEngineScript)
|
QWebEngineScript)
|
||||||
@ -181,7 +182,10 @@ def _update_stylesheet():
|
|||||||
"""Update the custom stylesheet in existing tabs."""
|
"""Update the custom stylesheet in existing tabs."""
|
||||||
css = shared.get_user_stylesheet()
|
css = shared.get_user_stylesheet()
|
||||||
code = javascript.assemble('stylesheet', 'set_css', css)
|
code = javascript.assemble('stylesheet', 'set_css', css)
|
||||||
for win_id in objreg.window_registry:
|
for win_id, window in objreg.window_registry.items():
|
||||||
|
# We could be in the middle of destroying a window here
|
||||||
|
if sip.isdeleted(window):
|
||||||
|
continue
|
||||||
tab_registry = objreg.get('tab-registry', scope='window',
|
tab_registry = objreg.get('tab-registry', scope='window',
|
||||||
window=win_id)
|
window=win_id)
|
||||||
for tab in tab_registry.values():
|
for tab in tab_registry.values():
|
||||||
|
Loading…
Reference in New Issue
Block a user