Fix bug #6491: Empty .emergency file causes crash.

If the load fails, we should not try to save an emergency file as the file was not yet fully loaded and weird things may happen.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33294 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-01-31 16:17:17 +00:00
parent d49438e76c
commit f0c386fa6b

View File

@ -93,6 +93,8 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty)
return 0; return 0;
} }
if (!b->loadLyXFile(filename)) { if (!b->loadLyXFile(filename)) {
// do not save an emergency file when releasing the buffer
b->markClean();
theBufferList().release(b); theBufferList().release(b);
return 0; return 0;
} }