The attached patch fixes this bug: crash on attempt to load non-existent included document. The problem was that the parent name of the current buffer was being set even if the document was not loaded (hit "cancel") and, if the document is not loaded, then the current buffer doesn't change, which means we're setting the parent name of the current buffer to be that of the current buffer, which leads to a loop. The fix is trivial once the problem is identified.
Seeking two OKs to commit. Richard -- ================================================================== Richard G Heck, Jr Professor of Philosophy Brown University http://frege.brown.edu/heck/ ================================================================== Get my public key from http://sks.keyserver.penguin.de Hash: 0x1DE91F1E66FFBDEC Learn how to sign your email using Thunderbird and GnuPG at: http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto
Index: src/LyXFunc.cpp =================================================================== --- src/LyXFunc.cpp (revision 18481) +++ src/LyXFunc.cpp (working copy) @@ -1413,18 +1413,20 @@ BOOST_ASSERT(lyx_view_); FileName const filename = makeAbsPath(argument, lyx_view_->buffer()->filePath()); - setMessage(bformat(_("Opening child document %1$s..."), - makeDisplayPath(filename.absFilename()))); view()->saveBookmark(false); string const parentfilename = lyx_view_->buffer()->fileName(); if (theBufferList().exists(filename.absFilename())) lyx_view_->setBuffer(theBufferList().getBuffer(filename.absFilename())); else - lyx_view_->loadLyXFile(filename); - // Set the parent name of the child document. - // This makes insertion of citations and references in the child work, - // when the target is in the parent or another child document. - lyx_view_->buffer()->setParentName(parentfilename); + if (lyx_view_->loadLyXFile(filename)) { + // Set the parent name of the child document. + // This makes insertion of citations and references in the child work, + // when the target is in the parent or another child document. + lyx_view_->buffer()->setParentName(parentfilename); + setMessage(bformat(_("Opening child document %1$s..."), + makeDisplayPath(filename.absFilename()))); + } else + setMessage(_("Document not loaded.")); break; }