From: Seonah Moon Date: Wed, 13 Mar 2024 08:27:19 +0000 (+0900) Subject: Use g_string_free_and_steal() if glib is greater than 2.76.0 X-Git-Tag: accepted/tizen/unified/20240315.032940^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F307803%2F2;p=platform%2Fframework%2Fweb%2Fdownload-provider.git Use g_string_free_and_steal() if glib is greater than 2.76.0 Change-Id: I11d2a944fbde6040700c21ac4bfe8caf41eb5472 --- diff --git a/agent/CMakeLists.txt b/agent/CMakeLists.txt index a919d65..d2a02c9 100755 --- a/agent/CMakeLists.txt +++ b/agent/CMakeLists.txt @@ -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 diff --git a/agent/download-agent-plugin-libcurl.c b/agent/download-agent-plugin-libcurl.c index e8a303d..e9559bc 100755 --- a/agent/download-agent-plugin-libcurl.c +++ b/agent/download-agent-plugin-libcurl.c @@ -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); diff --git a/packaging/download-provider.spec b/packaging/download-provider.spec index a82da48..1d60abc 100755 --- a/packaging/download-provider.spec +++ b/packaging/download-provider.spec @@ -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