Fix bug #7376. After deleting an inset, we try to update the screen using the singlePar optimization. One of the consequences is that the coordcache is not refreshed. Therefore, it is possible that the pointers to the insets in the coordcache are invalid and we should not access inset->name().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38011 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2011-03-23 16:25:43 +00:00
parent 5f15aabfe2
commit f4767138de

View File

@ -51,11 +51,14 @@ void CoordCache::clear()
void CoordCache::dump() const void CoordCache::dump() const
{ {
LYXERR0("InsetCache contains:"); LYXERR0("InsetCache contains:");
for (CoordCacheBase<Inset>::cache_type::const_iterator it = getInsets().getData().begin(); it != getInsets().getData().end(); ++it) { CoordCacheBase<Inset>::cache_type::const_iterator it =
Inset const * inset = it->first; getInsets().getData().begin();
for (; it != getInsets().getData().end(); ++it) {
// Warning: it is not guaranteed that inset is a valid pointer
// (therefore it has type 'void *') (see bug #7376).
void const * inset = it->first;
Point const p = it->second.pos; Point const p = it->second.pos;
LYXERR0("Inset " << inset << "(" << to_utf8(inset->name()) LYXERR0("Inset " << inset << " has point " << p.x_ << "," << p.y_);
<< ") has point " << p.x_ << "," << p.y_);
} }
} }