[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Jan 13 07:57:53 PST 2012


 sc/source/core/data/dptablecache.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 979448ca76591fc8346b7b0e8c24d653d6fec87b
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Fri Jan 13 10:52:56 2012 -0500

    Make sure no live ScDPObject instances hold reference to the deleted cache.

diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index 57f6ce1..1baec31 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


More information about the Libreoffice-commits mailing list