Prevent a crash if the user is not using a tmp directory.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6283 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-02-26 15:42:18 +00:00
parent fa09ff85c4
commit 9790d38b16
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-02-26 Angus Leeming <angus@localhost.localdomain>
* PreviewLoader.C (startLoading): Prevent a crash if the user is
not using a tmp directory.
2003-02-26 Angus Leeming <leeming@lyx.org>
* PreviewedInset.[Ch]: strip out the caching of the BufferView and

View File

@ -449,7 +449,11 @@ void PreviewLoader::Impl::startLoading()
lyxerr[Debug::GRAPHICS] << "PreviewLoader::startLoading()" << endl;
// As used by the LaTeX file and by the resulting image files
string const filename_base(unique_filename(buffer_.tmppath));
string directory = buffer_.tmppath;
if (directory.empty())
directory = buffer_.filePath();
string const filename_base(unique_filename(directory));
// Create an InProgress instance to place in the map of all
// such processes if it starts correctly.