diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-28 13:39:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-28 15:06:36 +0000 |
commit | 7acb634f58e86375f4a3cd4926a560679a45896f (patch) | |
tree | 0c84352ad8667e6eb141f3a3743ea5b3efdc93ea | |
parent | aa0499cefda1f808e6361e400d02a04cd4a0ef65 (diff) |
Resolves: fdo#85081 terminate if can't load kde addressbook
Change-Id: I3b1b78127d7d4080a23c0ac9f7d37706197de62c
-rw-r--r-- | connectivity/source/manager/mdrivermanager.cxx | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index 494a3043ddc9..6e90f651b31a 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -119,12 +119,26 @@ Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, W const DriverAccess& operator()( const DriverAccess& _rDescriptor ) const { - if ( !_rDescriptor.xDriver.is() ) - // we did not load this driver, yet - if ( _rDescriptor.xComponentFactory.is() ) - // we have a factory for it - const_cast< DriverAccess& >( _rDescriptor ).xDriver.set( - _rDescriptor.xComponentFactory->createInstanceWithContext( mxContext ), css::uno::UNO_QUERY); + // we did not load this driver, yet + if (!_rDescriptor.xDriver.is()) + { + // we have a factory for it + if (_rDescriptor.xComponentFactory.is()) + { + DriverAccess& rDesc = const_cast<DriverAccess&>(_rDescriptor); + try + { + //load driver + rDesc.xDriver.set( + rDesc.xComponentFactory->createInstanceWithContext(mxContext), css::uno::UNO_QUERY); + } + catch (const Exception&) + { + //failure, abandon driver + rDesc.xComponentFactory.clear(); + } + } + } return _rDescriptor; } |