From dfd5325e8facc907e0ed92a46b2f384ba36c955a Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 21 Apr 2011 19:15:02 +0000 Subject: [PATCH] branch: Fix bug #7376: Crash when deleting an Inset and using dbg -any. see r38011. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@38472 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/CoordCache.cpp | 11 +++++++---- status.16x | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/CoordCache.cpp b/src/CoordCache.cpp index 7593bcafc7..4cdc2f14a2 100644 --- a/src/CoordCache.cpp +++ b/src/CoordCache.cpp @@ -51,11 +51,14 @@ void CoordCache::clear() void CoordCache::dump() const { LYXERR0("InsetCache contains:"); - for (CoordCacheBase::cache_type::const_iterator it = getInsets().getData().begin(); it != getInsets().getData().end(); ++it) { - Inset const * inset = it->first; + CoordCacheBase::cache_type::const_iterator it = + 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; - LYXERR0("Inset " << inset << "(" << to_utf8(inset->name()) - << ") has point " << p.x_ << "," << p.y_); + LYXERR0("Inset " << inset << " has point " << p.x_ << "," << p.y_); } } diff --git a/status.16x b/status.16x index 55e8b86c65..d600053824 100644 --- a/status.16x +++ b/status.16x @@ -79,6 +79,8 @@ What's new - Fix a crash when moving the cursor up when there is an inset right above cursor which is not placed at the beginning of the line (bug 7261). + +- Fix a crash when deleting an inset and using -dbg any (bug 7376). - Fix assertion when selecting with shift+click immediately after reverse search, accept/reject all changes, or page down/up operations (bug 7394).