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)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 12 Apr 2023 13:39:39 +0000 (15:39 +0200)
commit31c5961c4f2768485d7fb252c3ac8071ae13b488
tree5a3471ad3c20de74c8132e169f68171a2b3a954c
parente9f7a9b8e60912bcbb412f5b0fcd437dac7b4735
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