Kaydet (Commit) 979448ca authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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

üst 20ac9b9d
...@@ -433,8 +433,22 @@ ScDPCache::ScDPCache(ScDocument* pDoc) : ...@@ -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() 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 bool ScDPCache::IsValid() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment