summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-12 09:11:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-12 09:12:10 +0200
commit24a57e2b854a1b8b3b8533ac72a6614ee29e374a (patch)
tree06423598f37017aefcd4f315cd6ac71a5dac9e78
parentf4fc28aedf9c673f368ddc00f3279f6d54c1a654 (diff)
Keep strings alive again as necessary
regression from commit 49eb02f07a5af44da59008a238e828b4a9532bef new loplugin:unusedvariablemore Change-Id: If92be219368a0dc33f40cd425efc6028c28c5e53
-rw-r--r--shell/source/sessioninstall/SyncDbusSessionHelper.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index cf95c1c568f9..09673698de9e 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -67,10 +67,13 @@ void request(
css::uno::Sequence<OUString> const & resources,
OUString const & interaction)
{
+ // Keep strings alive until after call to g_dbus_proxy_call_sync
+ std::vector<OString> resUtf8;
std::shared_ptr<GVariantBuilder> builder(
g_variant_builder_new(G_VARIANT_TYPE ("as")), GVariantBuilderDeleter());
for (auto & i: resources) {
auto s(OUStringToOString(i, RTL_TEXTENCODING_UTF8));
+ resUtf8.push_back(s);
g_variant_builder_add(builder.get(), "s", s.getStr());
}
auto iactUtf8(OUStringToOString(interaction, RTL_TEXTENCODING_UTF8));