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

Stephan Bergmann sbergman at redhat.com
Mon Sep 11 16:16:20 UTC 2017


 filter/source/xsltfilter/LibXSLTTransformer.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 31d606d42d3f2b0577c74af5778778c975d519ae
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 11 18:13:51 2017 +0200

    ...and fix previous commit cd8aeed1569222edd8bfd05d9d833f74b679fcd0
    
    "Fix data races during CppunitTest_filter_xslt".  (Funny how after each
    attempted fix, 'make CppunitTest_filter_xslt' succeeded multiple times in a row,
    and only started to fail ThreadSanitizer after pushing the attempted fix.)
    
    Change-Id: I24cab2dd1b068b02ccd4827cf8dcb11cf301d1c0

diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 869643003edb..0fc7e434c1ea 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -364,17 +364,13 @@ namespace XSLT
 
     void Reader::forceStateStopped()
     {
-        xsltTransformContextPtr tcontext;
-        {
-            std::unique_lock<std::mutex> g(m_mutex);
-            tcontext = m_tcontext;
-        }
-        if (!tcontext)
+        std::unique_lock<std::mutex> g(m_mutex);
+        if (!m_tcontext)
             return;
         //tdf#100057 If we force a cancel, libxslt will of course just keep on going unless something
         //tells it to stop. Here we force the stopped state so that libxslt will stop processing
         //and so Reader::execute will complete and we can join cleanly
-        tcontext->state = XSLT_STATE_STOPPED;
+        m_tcontext->state = XSLT_STATE_STOPPED;
     }
 
     Reader::~Reader()


More information about the Libreoffice-commits mailing list