BufferStorage::iterator const it =
find(bstore.begin(), bstore.end(), buf);
if (it != bstore.end()) {
+ Buffer const * parent = buf->parent();
Buffer * tmp = (*it);
bstore.erase(it);
LASSERT(tmp, return);
delete tmp;
+ if (parent)
+ // If this was a child, update the parent's buffer
+ // to avoid crashes due to dangling pointers (bug 9979)
+ parent->updateBuffer();
}
}
}
+void BufferList::invalidateConverterCache() const
+{
+ BufferStorage::const_iterator it = bstore.begin();
+ BufferStorage::const_iterator const en = bstore.end();
+ for (; it != en; ++it)
+ (*it)->params().invalidateConverterCache();
+}
+
+
bool BufferList::exists(FileName const & fname) const
{
return getBuffer(fname) != 0;