Use g_string_free_and_steal() if glib is greater than 2.76.0 03/307803/2 accepted/tizen/unified/20240315.032940 accepted/tizen/unified/x/20240318.021728
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 13 Mar 2024 08:27:19 +0000 (17:27 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 13 Mar 2024 08:27:21 +0000 (17:27 +0900)
Change-Id: I11d2a944fbde6040700c21ac4bfe8caf41eb5472

agent/CMakeLists.txt
agent/download-agent-plugin-libcurl.c
packaging/download-provider.spec

index a919d65..d2a02c9 100755 (executable)
@@ -38,6 +38,15 @@ SET(HEADERS
 
 INCLUDE(FindPkgConfig)
 
+pkg_check_modules(GLIB glib-2.0 REQUIRED)
+if(PKG_CONFIG_FOUND AND ${GLIB_VERSION} VERSION_GREATER 2.76.0)
+    message(STATUS "Glib version is greater than 2.76.0. ${GLIB_VERSION}")
+else()
+    message(STATUS "Using GLib version ${GLIB_VERSION}")
+       ADD_DEFINITIONS("-D_USE_G_STRING_FREE")
+endif()
+
+
 pkg_check_modules(subpkgs REQUIRED
        xdgmime
        vconf
index e8a303d..e9559bc 100755 (executable)
@@ -443,7 +443,11 @@ static char *__get_encoded_url(const char *url)
        } while (TRUE);
 
        char *result = encoded_url->str;
+#ifdef _USE_G_STRING_FREE
        g_string_free(encoded_url, FALSE);
+#else
+       g_string_free_and_steal(encoded_url);
+#endif
 
        DA_LOGI("encoded url[%s]", result);
 
index a82da48..1d60abc 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.3.12
+Version:    2.3.13
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0