[neon/backports-focal/xdg-desktop-portal/Neon/unstable] src: Unset fd from requests when it's been consumed

Bastien Nocera null at kde.org
Wed Jan 13 06:32:43 GMT 2021


Git commit 39c1be323f3c1f55f602a0edd710c43675678c83 by Bastien Nocera.
Committed on 20/07/2020 at 14:12.
Pushed by ash into branch 'Neon/unstable'.

Unset fd from requests when it's been consumed

M  +2    -0    src/open-uri.c
M  +2    -0    src/wallpaper.c

https://invent.kde.org/neon/backports-focal/xdg-desktop-portal/commit/39c1be323f3c1f55f602a0edd710c43675678c83

diff --git a/src/open-uri.c b/src/open-uri.c
index 31c8e9d..0dfcbde 100644
--- a/src/open-uri.c
+++ b/src/open-uri.c
@@ -675,6 +675,8 @@ handle_open_in_thread_func (GTask *task,
       scheme = g_strdup ("file");
       uri = g_filename_to_uri (path, NULL, NULL);
       g_object_set_data_full (G_OBJECT (request), "uri", g_strdup (uri), g_free);
+      close (fd);
+      g_object_set_data (G_OBJECT (request), "fd", GINT_TO_POINTER (-1));
     }
 
   g_object_set_data_full (G_OBJECT (request), "scheme", g_strdup (scheme), g_free);
diff --git a/src/wallpaper.c b/src/wallpaper.c
index 10cac60..4224a4f 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -248,6 +248,8 @@ handle_set_wallpaper_in_thread_func (GTask *task,
 
       uri = g_filename_to_uri (path, NULL, NULL);
       g_object_set_data_full (G_OBJECT (request), "uri", g_strdup (uri), g_free);
+      close (fd);
+      g_object_set_data (G_OBJECT (request), "fd", GINT_TO_POINTER (-1));
     }
 
   impl_request = xdp_impl_request_proxy_new_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (impl)),



More information about the Neon-commits mailing list