when fails on g_dbus_proxy_call_sync, the g_variant passed is released
automatically because it uses floating reference count.
so we should convert the g_variant to using normal reference count and
handle reference count manually.
Change-Id: I46b41c0d3f89eca3122a293a47e393b455c973e6
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
GVariant *result = NULL;
int retry_cnt = 0;
+ /* convert floating ref into normal ref */
+ g_variant_ref_sink(params);
+
do {
proxy = g_dbus_proxy_new_sync(cc->conn, G_DBUS_PROXY_FLAGS_NONE, NULL,
COMM_PKGMGR_DBUS_SERVICE, COMM_PKGMGR_DBUS_OBJECT_PATH,
retry_cnt++;
} while (retry_cnt <= COMM_CLIENT_RETRY_MAX);
+ /* decrease ref count to 0 to free resource */
+ g_variant_unref(params);
+
return result;
}