diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-13 10:52:56 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-13 10:58:15 -0500 |
commit | 979448ca76591fc8346b7b0e8c24d653d6fec87b (patch) | |
tree | f91a48df3621c3e3b9a50c0d0622ca48873b58eb /sc | |
parent | Uploading a new fresh shiny libvisio 0.0.13 (diff) | |
download | core-979448ca76591fc8346b7b0e8c24d653d6fec87b.tar.gz core-979448ca76591fc8346b7b0e8c24d653d6fec87b.zip |
Make sure no live ScDPObject instances hold reference to the deleted cache.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dptablecache.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index 57f6ce18cda1..1baec319146e 100644 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -433,8 +433,22 @@ ScDPCache::ScDPCache(ScDocument* pDoc) : { } +namespace { + +struct ClearObjectSource : std::unary_function<ScDPObject*, void> +{ + void operator() (ScDPObject* p) const + { + p->ClearSource(); + } +}; + +} + ScDPCache::~ScDPCache() { + // Make sure no live ScDPObject instances hold reference to this cache any more. + std::for_each(maRefObjects.begin(), maRefObjects.end(), ClearObjectSource()); } bool ScDPCache::IsValid() const |