Anki doesn't close in Flatpak Version 24.04.1

Flatpak Version 24.04.1 breaks Anki’s ability to close. The program will appear to close but will fail to start up the next time you open it.

Here’s the debug log:

sakura@localhost ~> flatpak run net.ankiweb.Anki
Anki starting...
Initial setup...
Preparing to run...
Trying to use X11, but it is not available. Falling back to Wayland, which has some bugs:
https://github.com/ankitects/anki/issues/1767
Starting main loop...
Window should have been closed: <aqt.progress.ProgressDialog object at 0x7f55c6c2dee0>
2024-04-30 16:06:46,160:WARNING:waitress: unhandled close event
Error in sys.excepthook:
TypeError: 'NoneType' object is not callable

Original exception was:
Traceback (most recent call last):
  File "aqt.taskman", line 142, in _on_closures_pending
  File "aqt.taskman", line 86, in <lambda>
  File "aqt.progress", line 239, in do_window_cleanup
RuntimeError: wrapped C/C++ object of type QTimer has been deleted

The program then remains open indefinitely despite the window being closed. Subsequent attempts to open Anki fail:

sakura@localhost ~> flatpak run net.ankiweb.Anki
Anki starting...
Initial setup...
Preparing to run...
Trying to use X11, but it is not available. Falling back to Wayland, which has some bugs:
https://github.com/ankitects/anki/issues/1767
Already running; reusing existing instance.

The program can only be reopened after force killing the program with flatpak kill net.ankiweb.Anki

I solved the issue by downgrading to commit 5fb2e0bf6067c2d336cfa84059e7883fc6927ac5f332dfee4b5dba9735225318 published on 2024-01-11

A fix for this is coming in the next update.

2 Likes