diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-05 10:04:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-05 14:57:55 +0000 |
commit | 45ae39b3c6d356b5ea050032e3a911072496f269 (patch) | |
tree | a1cc4f3cb6d543d229b702b9cc02f3d729006380 /vcl/workben | |
parent | 32ae77e28d98a60c396d274e1e2ff44fe6265a9b (diff) |
coverity#1215389 Uncaught exception
Change-Id: I107817e730ca0bd94d66ecf9719c3a6eb273e4f1
Diffstat (limited to 'vcl/workben')
-rw-r--r-- | vcl/workben/vcldemo.cxx | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index f79340135004..7fe1b2d09fb7 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -43,19 +43,27 @@ void Main(); SAL_IMPLEMENT_MAIN() { - tools::extendApplicationEnvironment(); - - Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext(); - Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY ); - - if( !xServiceManager.is() ) - Application::Abort( "Failed to bootstrap" ); - - comphelper::setProcessServiceFactory( xServiceManager ); - - InitVCL(); - ::Main(); - DeInitVCL(); + try + { + tools::extendApplicationEnvironment(); + + Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext(); + Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY ); + + if( !xServiceManager.is() ) + Application::Abort( "Failed to bootstrap" ); + + comphelper::setProcessServiceFactory( xServiceManager ); + + InitVCL(); + ::Main(); + DeInitVCL(); + } + catch (const Exception& e) + { + SAL_WARN("vcl.app", "Fatal exception: " << e.Message); + return 1; + } return 0; } |