Kaydet (Commit) 0f8be9de authored tarafından Mike Kaganski's avatar Mike Kaganski

Guard read access of static data

Change-Id: I257bf0a1efb36b5d2c4cd7d932cc400dfafa0846
Reviewed-on: https://gerrit.libreoffice.org/48821Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 3b57cb72
...@@ -125,10 +125,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque ...@@ -125,10 +125,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
if ( anyExc >>= e1 ) if ( anyExc >>= e1 )
{ {
SolarMutexGuard aSolarGuard;
if( !g_JavaEvents.bNotFoundHandled ) if( !g_JavaEvents.bNotFoundHandled )
{ {
// No suitable JRE found // No suitable JRE found
SolarMutexGuard aSolarGuard;
g_JavaEvents.bNotFoundHandled = true; g_JavaEvents.bNotFoundHandled = true;
#if defined( MACOSX ) #if defined( MACOSX )
ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, SvtResId(STR_WARNING_JAVANOTFOUND_MAC), VclMessageType::Warning); ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, SvtResId(STR_WARNING_JAVANOTFOUND_MAC), VclMessageType::Warning);
...@@ -153,10 +153,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque ...@@ -153,10 +153,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
} }
else if ( anyExc >>= e2 ) else if ( anyExc >>= e2 )
{ {
SolarMutexGuard aSolarGuard;
if( !g_JavaEvents.bInvalidSettingsHandled ) if( !g_JavaEvents.bInvalidSettingsHandled )
{ {
// javavendors.xml was updated and Java has not been configured yet // javavendors.xml was updated and Java has not been configured yet
SolarMutexGuard aSolarGuard;
g_JavaEvents.bInvalidSettingsHandled = true; g_JavaEvents.bInvalidSettingsHandled = true;
#ifdef MACOSX #ifdef MACOSX
ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, SvtResId(STR_WARNING_INVALIDJAVASETTINGS_MAC), VclMessageType::Warning); ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, SvtResId(STR_WARNING_INVALIDJAVASETTINGS_MAC), VclMessageType::Warning);
...@@ -173,9 +173,9 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque ...@@ -173,9 +173,9 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
} }
else if ( anyExc >>= e3 ) else if ( anyExc >>= e3 )
{ {
SolarMutexGuard aSolarGuard;
if( !g_JavaEvents.bDisabledHandled ) if( !g_JavaEvents.bDisabledHandled )
{ {
SolarMutexGuard aSolarGuard;
g_JavaEvents.bDisabledHandled = true; g_JavaEvents.bDisabledHandled = true;
// Java disabled. Give user a chance to enable Java inside Office. // Java disabled. Give user a chance to enable Java inside Office.
ScopedVclPtrInstance<MessageDialog> aQueryBox(nullptr , "JavaDisabledDialog", ScopedVclPtrInstance<MessageDialog> aQueryBox(nullptr , "JavaDisabledDialog",
...@@ -196,10 +196,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque ...@@ -196,10 +196,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
} }
else if ( anyExc >>= e4 ) else if ( anyExc >>= e4 )
{ {
SolarMutexGuard aSolarGuard;
if( !g_JavaEvents.bVMCreationFailureHandled ) if( !g_JavaEvents.bVMCreationFailureHandled )
{ {
// Java not correctly installed, or damaged // Java not correctly installed, or damaged
SolarMutexGuard aSolarGuard;
g_JavaEvents.bVMCreationFailureHandled = true; g_JavaEvents.bVMCreationFailureHandled = true;
#ifdef MACOSX #ifdef MACOSX
ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SvtResId(STR_ERROR_JVMCREATIONFAILED_MAC)); ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SvtResId(STR_ERROR_JVMCREATIONFAILED_MAC));
...@@ -216,11 +216,11 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque ...@@ -216,11 +216,11 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
} }
else if ( anyExc >>= e5 ) else if ( anyExc >>= e5 )
{ {
SolarMutexGuard aSolarGuard;
if( !g_JavaEvents.bRestartRequiredHandled ) if( !g_JavaEvents.bRestartRequiredHandled )
{ {
// a new JRE was selected, but office needs to be restarted // a new JRE was selected, but office needs to be restarted
//before it can be used. //before it can be used.
SolarMutexGuard aSolarGuard;
g_JavaEvents.bRestartRequiredHandled = true; g_JavaEvents.bRestartRequiredHandled = true;
svtools::executeRestartDialog( svtools::executeRestartDialog(
comphelper::getProcessComponentContext(), nullptr, comphelper::getProcessComponentContext(), nullptr,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment