diff options
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/scopeguard.cxx | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/comphelper/source/misc/scopeguard.cxx b/comphelper/source/misc/scopeguard.cxx index f159b293ed3b..6eeb7c8e166c 100644 --- a/comphelper/source/misc/scopeguard.cxx +++ b/comphelper/source/misc/scopeguard.cxx @@ -26,27 +26,18 @@ namespace comphelper { ScopeGuard::~ScopeGuard() { - if (m_func) - { - if (m_excHandling == IGNORE_EXCEPTIONS) - { - try { - m_func(); - } - catch (css::uno::Exception & exc) { - (void) exc; // avoid warning about unused variable - OSL_FAIL( - OUStringToOString( "UNO exception occurred: " + - exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); - } - catch (...) { - OSL_FAIL( "unknown exception occurred!" ); - } - } - else - { - m_func(); - } + if (!m_func) + return; + try { + m_func(); + } + catch (css::uno::Exception & exc) { + (void) exc; // avoid warning about unused variable + OSL_FAIL( OUStringToOString( "UNO exception occurred: " + exc.Message, + RTL_TEXTENCODING_UTF8 ).getStr() ); + } + catch (...) { + OSL_FAIL( "unknown exception occurred!" ); } } |