X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=9ec20e0fbbcb09b24277260cb8e453a4767dd89c;hb=3561caa3a171a5984ee7a10b7ea82f7f4b7226e8;hp=d7e827fc2aa05f427d0d187b744ec383e66801d6;hpb=0120c3fc10f1f1cc062f0c2a445fcee5d336d9f3;p=lyx.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index d7e827fc2a..9ec20e0fbb 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -538,10 +538,10 @@ Buffer::~Buffer() for (; it != end; ++it) { Buffer * child = const_cast(it->first); if (theBufferList().isLoaded(child)) { - if (theBufferList().isOthersChild(this, child)) - child->setParent(0); - else - theBufferList().release(child); + if (theBufferList().isOthersChild(this, child)) + child->setParent(0); + else + theBufferList().release(child); } } @@ -2446,15 +2446,16 @@ void Buffer::reloadBibInfoCache() const return; d->bibinfo_.clear(); - collectBibKeys(); + FileNameList checkedFiles; + collectBibKeys(checkedFiles); d->bibinfo_cache_valid_ = true; } -void Buffer::collectBibKeys() const +void Buffer::collectBibKeys(FileNameList & checkedFiles) const { for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) - it->collectBibKeys(it); + it->collectBibKeys(it, checkedFiles); } @@ -3720,8 +3721,12 @@ void Buffer::listMacroNames(MacroNameSet & macros) const // loop over children Impl::BufferPositionMap::iterator it = d->children_positions.begin(); Impl::BufferPositionMap::iterator end = d->children_positions.end(); - for (; it != end; ++it) - it->first->listMacroNames(macros); + for (; it != end; ++it) { + Buffer * child = const_cast(it->first); + // The buffer might have been closed (see #10766). + if (theBufferList().isLoaded(child)) + child->listMacroNames(macros); + } // call parent Buffer const * const pbuf = d->parent(); @@ -4912,8 +4917,10 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType utype) const switch (par.itemdepth) { case 2: enumcounter += 'i'; + // fall through case 1: enumcounter += 'i'; + // fall through case 0: enumcounter += 'i'; break;