gtk/dialogs: Destroy the window promptly on finish async function
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 11 Apr 2023 22:41:20 +0000 (00:41 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Apr 2023 07:17:07 +0000 (09:17 +0200)
commite63a066ced2afce06402c48467a150acb284d13b
treea5160f3638a5d9f79eee7c2f4893f5b04a516a91
parentf66b6e5059b987ea2af09c188436fdaa78b65cf1
gtk/dialogs: Destroy the window promptly on finish async function

Some bindings (GJS!) could add temporary references to the GAsyncResult
argument that we return, and thus to the GTask, which may cause the
dialog not to close when the finish function is called (but at garbage
collection instead!).

To prevent this, just manually destroy the window (by removing the task
data), so that we are not bound to the GTask lifetime anymore.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5741
gtk/gtkalertdialog.c
gtk/gtkcolordialog.c
gtk/gtkfiledialog.c
gtk/gtkfontdialog.c