From ba9ebcf8f977ab7e1763b644e32f181f5e7b355c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 15 Dec 2018 12:45:17 +1000 Subject: [PATCH] make sure change note type clears up hooks if an error occurred after QDialog.accept() had been called, the hook was left lying around and caused errors when reset later fired File "aqt\main.py", line 1028, in onCheckDB File "aqt\main.py", line 516, in reset File "anki\hooks.py", line 28, in runHook File "aqt\modelchooser.py", line 47, in onReset File "aqt\modelchooser.py", line 82, in updateModels : wrapped C/C++ object of type QPushButton has been deleted --- aqt/browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aqt/browser.py b/aqt/browser.py index dfff1175a..0dcbcacbf 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -2063,7 +2063,6 @@ Any cards mapped to nothing will be deleted. \ If a note has no remaining cards, it will be lost. \ Are you sure you want to continue?""")): return - QDialog.accept(self) self.browser.mw.checkpoint(_("Change Note Type")) b = self.browser b.mw.col.modSchema(check=True) @@ -2076,6 +2075,7 @@ Are you sure you want to continue?""")): b.mw.progress.finish() b.mw.reset() self.cleanup() + QDialog.accept(self) def onHelp(self): openHelp("browsermisc")