Fix handling g_dbus_proxy_call_sync
authorMaciej Piotrowski <m.piotrowski@samsung.com>
Thu, 15 Jan 2015 15:19:53 +0000 (16:19 +0100)
committerMaciej Piotrowski <m.piotrowski@samsung.com>
Thu, 15 Jan 2015 16:30:41 +0000 (17:30 +0100)
This patch frees values returned by this function, what should be done
manually according to documentation
https://developer.gnome.org/gio/stable/GDBusProxy.html#g-dbus-proxy-call-sync

src/application/application.cc
src/web_setting/web_setting.cc

index 455d9e8..10aee9c 100644 (file)
@@ -90,6 +90,7 @@ picojson::value* Application::Exit() {
     g_error_free(error);
     return CreateResultMessage(WebApiAPIErrors::UNKNOWN_ERR);
   }
+  g_variant_unref(result);
   return CreateResultMessage();
 }
 
@@ -108,6 +109,7 @@ picojson::value* Application::Hide() {
     g_error_free(error);
     return CreateResultMessage(WebApiAPIErrors::UNKNOWN_ERR);
   }
+  g_variant_unref(result);
   return CreateResultMessage();
 }
 
index 41df642..bcfcd3c 100644 (file)
@@ -76,6 +76,7 @@ std::unique_ptr<picojson::value> WebSetting::RemoveAllCookies() {
     g_error_free(error);
     return CreateResultMessage(WebApiAPIErrors::UNKNOWN_ERR);
   }
+  g_variant_unref(result);
   return CreateResultMessage();
 }
 
@@ -96,5 +97,6 @@ std::unique_ptr<picojson::value> WebSetting::SetUserAgentString(
     g_error_free(error);
     return CreateResultMessage(WebApiAPIErrors::UNKNOWN_ERR);
   }
+  g_variant_unref(result);
   return CreateResultMessage();
 }