Closed iamllama closed 3 weeks ago
It would be nice to have the cleanup and memory leak stuff split out into a separate pr.
Thank you for your work on this!
Sorry just realised while working on another feature that the merge conflict was handled incorrectly
It's currently
def on_window_close(_):
gui_hooks.webview_will_show_context_menu.remove(self.add_webview_context_menu_items)
self.win.closeEvent = on_window_close
qconnect(self.win.finished, lambda _: self.wv.cleanup())
mw.garbage_collect_on_dialog_finish(self.win)
when it should be
def on_window_close(_):
self.wv.cleanup()
gui_hooks.webview_will_show_context_menu.remove(self.add_webview_context_menu_items)
qconnect(self.win.finished, on_window_close)
mw.garbage_collect_on_dialog_finish(self.win)
self.win.closeEvent
was left in and the problem mentioned in #12 still applies, whereby the hook isn't cleaned up :/
Thanks, pushed the fix.
Closes #6 (got waylaid for a few weeks 😅)
~~EDIT: Also included a fix for #10. Apparently
closeEvent
isn't called when the dialog is rejected, i.e. whenClose
is pressed. There's also a small amount of memory stil being leaked, which I presume is the dialog itself. Callingmw.garbage_collect_on_dialog_finish
seems to clear it up~~