summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-09-19 15:49:25 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-09-19 21:40:11 +0200
commitc9b1cb5ae36b1057fb185945b52d3e45c5436bb6 (patch)
treec26da964820a3ded0e0599ac103d160fb6ad8388 /dbaccess
parent0803f08bb135ec52d58171279d95b9ef542bcabd (diff)
Avoid premature deletion of objects in ODatabaseContext::m_aDatabaseObjects.
Access of deleted objects found with valgrind/memcheck of dbaccess/qa/unoapi.
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 22f77a71f6fb..f542d2b75477 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -291,7 +291,10 @@ void ODatabaseContext::disposing()
++aIter
)
{
- aIter->second->dispose();
+ rtl::Reference< ODatabaseModelImpl > obj(aIter->second);
+ // make sure obj is acquired and does not delete itself from within
+ // dispose()
+ obj->dispose();
}
m_aDatabaseObjects.clear();
}