linguistic/source/lngsvcmgr.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit ed030f17b92abd4681fea3db0a3dc421141e5075
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Apr 27 16:32:52 2020 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Apr 27 16:44:21 2020 +0200

    linguistic: make LngSvcMgr::GetAvailableGrammarSvcs_Impl() more readable
    
    It's not exactly clear why, but as a side effect, this makes a crash in
    uno::Reference::release() go away in the --enable-macosx-sandbox case.
    But it helps readability as well, so why not.
    
    The root cause is probabably either a compiler bug or the old code
    depends on a longer lifetime of the temporaries involved in the function
    call, but that's not clear to me.
    
    Change-Id: I5f987129d3301d30ebf732757a4f1ba4bdbb8d52

diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index f8d373a6c554..e0bc1774c000 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1009,7 +1009,14 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
                 {
                     try
                     {
-                        xSvc.set( ( xCompFactory.is() ? 
xCompFactory->createInstanceWithContext( xContext ) : 
xFactory->createInstance() ), uno::UNO_QUERY );
+                        if (xCompFactory.is())
+                        {
+                            
xSvc.set(xCompFactory->createInstanceWithContext(xContext), uno::UNO_QUERY);
+                        }
+                        else
+                        {
+                            xSvc.set(xFactory->createInstance(), 
uno::UNO_QUERY);
+                        }
                     }
                     catch (const uno::Exception &)
                     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to