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

Kohei Yoshida kohei.yoshida at collabora.com
Thu May 25 03:27:50 UTC 2017


 svl/source/misc/sharedstring.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 50fc62ce76bc51f18b16eae937761d0a8872df3e
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue May 23 20:52:02 2017 -0400

    tdf#107945: Perhaps this will make this method thread-safe...
    
    Assuming that rtl_uString_new() is thread-safe, and static variable
    initialization is technically thread-safe, hopefully we can declare
    this static method thread-safe now.
    
    Change-Id: Ibc3685a576c2a6692bdf2beff79592290b42cc8a
    Reviewed-on: https://gerrit.libreoffice.org/38011
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/svl/source/misc/sharedstring.cxx b/svl/source/misc/sharedstring.cxx
index 9235783ce774..28f6473d0377 100644
--- a/svl/source/misc/sharedstring.cxx
+++ b/svl/source/misc/sharedstring.cxx
@@ -15,7 +15,7 @@ SharedString SharedString::getEmptyString()
 {
     // unicode string array for empty string is globally shared in OUString.
     // Let's take advantage of that.
-    rtl_uString* pData = nullptr;
+    static rtl_uString* pData = nullptr;
     rtl_uString_new(&pData);
     return SharedString(pData, pData);
 }


More information about the Libreoffice-commits mailing list