[Libreoffice-commits] core.git: shell/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Apr 12 07:14:30 UTC 2018


 shell/source/sessioninstall/SyncDbusSessionHelper.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 24a57e2b854a1b8b3b8533ac72a6614ee29e374a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Apr 12 09:11:03 2018 +0200

    Keep strings alive again as necessary
    
    regression from
        commit 49eb02f07a5af44da59008a238e828b4a9532bef
        new loplugin:unusedvariablemore
    
    Change-Id: If92be219368a0dc33f40cd425efc6028c28c5e53

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));


More information about the Libreoffice-commits mailing list