mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
fix error in webview __del__ on shutdown
This commit is contained in:
parent
5600d2824c
commit
a403b957cc
1 changed files with 5 additions and 1 deletions
|
@ -664,6 +664,10 @@ document.head.appendChild(style);
|
|||
self._page.setContent(cast(QByteArray, bytes("", "ascii")))
|
||||
|
||||
def __del__(self) -> None:
|
||||
from aqt import mw
|
||||
try:
|
||||
from aqt import mw
|
||||
except ImportError:
|
||||
# this will fail when __del__ is called during app shutdown
|
||||
return
|
||||
|
||||
mw.mediaServer.clear_page_html(id(self))
|
||||
|
|
Loading…
Reference in a new issue