On Tue, Nov 02, 2021 at 08:08:05AM +0100, Jürgen Spitzmüller wrote: > Am Montag, dem 01.11.2021 um 22:51 +0100 schrieb Pavel Sanda: > > I don't know the code in question either, but I can try to look later > > this week. > > OTOH we test for empty toc_ in several other places of the TocModel, so > the check the patch adds might be reasonable
Yes. > (maybe the toc is not yet re-created at that point). I believe something else is going on. When you add something like +++ b/src/frontends/qt/TocModel.cpp @@ -327,6 +330,7 @@ TocItem const TocModels::currentItem(QString const & type, } LASSERT(index.model() == it.value()->model(), return TocItem()); + lyxerr<<type.toStdString()<<" ";lyxerr<<&models_ << " " << *it << " " << it.value()->toc_->empty() << "\n"; return it.value()->tocItem(index); } You can see steady flow of identical lines, e.g. tableofcontents 0x55a7b8d94af8 0x55a7b9c931f0 0 associated with the first window. Then you create second window open new view of the same file and get steady flow of second type e.g. tableofcontents 0x55a7ba5e5438 0x55a7ba817910 0 until the last line before crash tableofcontents 0x55a7b8d94af8 0x55a7b9c931f0 1 which is again pointing to structure associated with window 1 but now empty. So instead of missing initialization we likely destroy the content of first structure meanwhile. We call various reset() and clear() routines many many times, and its unclear to me why we repeatedlt call the whole machinery. My time for this issue is spent for today... Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel