# Anki doesn't close in Flatpak Version 24.04.1

**URL:** <https://forums.ankiweb.net/t/anki-doesnt-close-in-flatpak-version-24-04-1/44251>\
**Category:** Help\
**Created:** [April 30, 2024, 8:12pm UTC](https://forums.ankiweb.net/t/anki-doesnt-close-in-flatpak-version-24-04-1/44251 "2024-04-30T20:12:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natsumi](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@Natsumi](https://forums.ankiweb.net/u/Natsumi)\
**Post date:** [April 30, 2024, 8:12pm UTC](https://forums.ankiweb.net/t/anki-doesnt-close-in-flatpak-version-24-04-1/44251/1 "2024-04-30T20:12:57Z")

</div>

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:

```auto
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:

```auto
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

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [May 2, 2024, 12:15pm UTC](https://forums.ankiweb.net/t/anki-doesnt-close-in-flatpak-version-24-04-1/44251/2 "2024-05-02T12:15:44Z")

</div>

A fix for this is coming in the next update.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [June 1, 2024, 12:16pm UTC](https://forums.ankiweb.net/t/anki-doesnt-close-in-flatpak-version-24-04-1/44251/3 "2024-06-01T12:16:35Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
