Fix CAS input on windows (bug 10262)

This is the well known file locking problem: The TempFile class keeps the
created file locked for the own process, and this prevents the CAS to read it.
This commit is contained in:
Georg Baum 2016-07-02 18:58:30 +02:00
parent 3c56e7c0eb
commit 6dfc255088

View File

@ -1001,8 +1001,13 @@ namespace {
{ {
// In order to avoid parsing problems with command interpreters // In order to avoid parsing problems with command interpreters
// we pass input data through a file // we pass input data through a file
TempFile tempfile("casinput"); // Since the CAS is supposed to read the temp file we need
FileName const cas_tmpfile = tempfile.name(); // to unlock it on windows (bug 10262).
unique_ptr<TempFile> tempfile(new TempFile("casinput"));
tempfile->setAutoRemove(false);
FileName const cas_tmpfile = tempfile->name();
tempfile.reset();
if (cas_tmpfile.empty()) { if (cas_tmpfile.empty()) {
lyxerr << "Warning: cannot create temporary file." lyxerr << "Warning: cannot create temporary file."
<< endl; << endl;