diff options
author | Michael Stahl <mst@openoffice.org> | 2011-09-15 14:01:39 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-09-15 14:07:30 +0200 |
commit | f69eb5b70342cbb499dc9b99a5eb78e59eb2d416 (patch) | |
tree | b6e46403003690237de96cdb49e6617f3bfff9ed /dbaccess | |
parent | 3c6d38fed033ba8b47af75a9b8712a4bd2c0ddec (diff) |
dbaccess: databasecontext.cxx: copy m_aDatabaseObjects
this fixes an STL assertion due to invalidated iterator.
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/databasecontext.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 3ce9914ddb34..22f77a71f6fb 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -283,8 +283,10 @@ void ODatabaseContext::disposing() m_aContainerListeners.disposeAndClear(aDisposeEvent); // dispose the data sources - ObjectCache::iterator aEnd = m_aDatabaseObjects.end(); - for ( ObjectCache::iterator aIter = m_aDatabaseObjects.begin(); + // disposing seems to remove elements, so work on copy for valid iterators + ObjectCache objCopy(m_aDatabaseObjects); + ObjectCache::iterator const aEnd = objCopy.end(); + for ( ObjectCache::iterator aIter = objCopy.begin(); aIter != aEnd; ++aIter ) |