filechooserportal: Take a ref on transient-for

This may fix a crash that has been reported in
file_chooser_portal_data_free.

Fixes: #4314
This commit is contained in:
Matthias Clasen 2021-10-06 22:37:45 -04:00
parent 8d9c3920bb
commit c7d6bf733a

View File

@ -79,6 +79,8 @@ filechooser_portal_data_free (FilechooserPortalData *data)
if (data->exported_window)
gtk_window_unexport_handle (data->exported_window);
g_clear_object (&data->exported_window);
g_free (data->portal_handle);
g_free (data);
@ -501,7 +503,7 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self,
}
else
{
data->exported_window = transient_for;
data->exported_window = g_object_ref (transient_for);
}
}
else