[glib-networking/mcatanzaro/proxy-validation: 5/7] Use px_proxy_factory_free_proxies()




commit 8bfbdf3a8b949f0a2264a829c2a6f953482fba2a
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Tue Jun 28 13:09:28 2022 -0500

    Use px_proxy_factory_free_proxies()
    
    I've been waiting to do this for a long time!
    
    Part-of: <https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/212>

 meson.build                        |  2 +-
 proxy/libproxy/glibproxyresolver.c | 17 +----------------
 2 files changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/meson.build b/meson.build
index bacc545e..6f50ee14 100644
--- a/meson.build
+++ b/meson.build
@@ -69,7 +69,7 @@ endif
 assert(gio_module_dir != '', 'GIO_MODULE_DIR is missing from gio-2.0.pc')
 
 # *** Checks for LibProxy   ***
-libproxy_dep = dependency('libproxy-1.0', version: '>= 0.3.1', required: get_option('libproxy'))
+libproxy_dep = dependency('libproxy-1.0', version: '>= 0.4.16', required: get_option('libproxy'))
 
 # *** Checks for GNOME      ***
 gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas', required: get_option('gnome_proxy'))
diff --git a/proxy/libproxy/glibproxyresolver.c b/proxy/libproxy/glibproxyresolver.c
index a5c22a18..3f5a4f05 100644
--- a/proxy/libproxy/glibproxyresolver.c
+++ b/proxy/libproxy/glibproxyresolver.c
@@ -120,21 +120,6 @@ copy_proxies (gchar **proxies)
   return copy;
 }
 
-/* FIXME: this function should be removed and replaced by a call to
- * px_proxy_factory_free_proxies() once libproxy 0.4.16 is released.
- * Sadly libproxy does not have any version check macros so it will
- * have to be a hard dep.
- */
-static void
-free_libproxy_proxies (gchar **proxies)
-{
-  int i;
-
-  for (i = 0; proxies[i]; i++)
-    free (proxies[i]);
-  free (proxies);
-}
-
 static void
 get_libproxy_proxies (GTask        *task,
                       gpointer      source_object,
@@ -156,7 +141,7 @@ get_libproxy_proxies (GTask        *task,
        * three entries ("socks5", "socks4a", "socks4").
        */
       g_task_return_pointer (task, copy_proxies (proxies), (GDestroyNotify) g_strfreev);
-      free_libproxy_proxies (proxies);
+      px_proxy_factory_free_proxies (proxies);
     }
   else
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]