Kaydet (Commit) 054dac27 authored tarafından Caolán McNamara's avatar Caolán McNamara

call g_variant_unref on return value

Change-Id: If8f0e443738060f51c8822783558ea14fb34b8ce
Reviewed-on: https://gerrit.libreoffice.org/46962Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e39245e2
......@@ -18,7 +18,7 @@ using namespace ::com::sun::star::uno;
namespace
{
struct GVariantDeleter { void operator()(GVariant* pV) { g_variant_unref(pV); } };
struct GVariantDeleter { void operator()(GVariant* pV) { if (pV) g_variant_unref(pV); } };
struct GVariantBuilderDeleter { void operator()(GVariantBuilder* pVB) { g_variant_builder_unref(pVB); } };
template <typename T> struct GObjectDeleter { void operator()(T* pO) { g_object_unref(pO); } };
class GErrorWrapper
......@@ -72,12 +72,12 @@ void request(
std::shared_ptr<GDBusProxy> proxy(
lcl_GetPackageKitProxy("Modify"), GObjectDeleter<GDBusProxy>());
GErrorWrapper error;
g_dbus_proxy_call_sync(
std::shared_ptr<GVariant> result(g_dbus_proxy_call_sync(
proxy.get(), method,
g_variant_new(
"(uass)", static_cast<guint32>(xid), builder.get(),
iactUtf8.getStr()),
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef());
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef()), GVariantDeleter());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment