On Sat, Jul 02, 2016 at 10:10:00PM -0400, Scott Kostyshak wrote:
> On Sat, Jul 02, 2016 at 06:59:46PM +0200, Georg Baum wrote:
> > commit 6dfc255088ecd3393c4c5dc3d2c5357a3fbabfc0
> > Author: Georg Baum <[email protected]>
> > Date:   Sat Jul 2 18:58:30 2016 +0200
> > 
> >     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.
> > ---
> >  src/mathed/MathExtern.cpp |    9 +++++++--
> >  1 files changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp
> > index b3443fa..8b1e0f0 100644
> > --- a/src/mathed/MathExtern.cpp
> > +++ b/src/mathed/MathExtern.cpp
> > @@ -1001,8 +1001,13 @@ namespace {
> >     {
> >             // In order to avoid parsing problems with command interpreters
> >             // we pass input data through a file
> > -           TempFile tempfile("casinput");
> > -           FileName const cas_tmpfile = tempfile.name();
> > +           // Since the CAS is supposed to read the temp file we need
> > +           // 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()) {
> >                     lyxerr << "Warning: cannot create temporary file."
> >                            << endl;
> 
> Any chance that similar fixes could fix the following two bugs?
> http://www.lyx.org/trac/ticket/10043
> http://www.lyx.org/trac/ticket/10091

Georg, I'd be curious if you think a similar fix could fix #10043 and
#10091.

Scott

Attachment: signature.asc
Description: PGP signature

Reply via email to