summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-22 11:01:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-22 20:07:50 +0100
commit054dac27e0b33789bbb3ca444ae22ab4b157f998 (patch)
tree10743437005e159074c05753c3cc940ad261f669 /shell
parente39245e2c5000241078a557d3b49da254da7effd (diff)
call g_variant_unref on return value
Change-Id: If8f0e443738060f51c8822783558ea14fb34b8ce Reviewed-on: https://gerrit.libreoffice.org/46962 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/sessioninstall/SyncDbusSessionHelper.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index ce3cb8aefca0..4092d146f7c2 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -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());
}
}