Author: kuemmel
Date: Sat Jan 22 10:30:03 2011
New Revision: 37292
URL: http://www.lyx.org/trac/changeset/37292

Log:
make a copy of Converters because this function is used by our export/preview 
threads
and the converters is also used by the main thread (getStatus).

LyX.exe!lyx::Buffer::doExport
LyX.exe!lyx::Buffer::preview(
LyX.exe!std::tr1::_Pmf_caller3<
LyX.exe!std::tr1::_Pmf_caller3<
LyX.exe!std::tr1::_Callable_pmf<
LyX.exe!std::tr1::_Bind3<
LyX.exe!std::tr1::_Bind_base<
LyX.exe!lyx::frontend::GuiView::GuiViewPrivate::runAndDestroy<
LyX.exe!lyx::frontend::GuiView::GuiViewPrivate::previewAndDestroy(
LyX.exe!QtConcurrent::StoredFunctorCall3<
LyX.exe!QtConcurrent::RunFunctionTask(
QtCored4.dll!QThreadPoolThread::run(
QtCored4.dll!QThreadPrivate::start(
msvcr100d.dll!_callthreadstartex() 
msvcr100d.dll!_threadstartex(void * ptd)

Modified:
   lyx-devel/trunk/src/Buffer.cpp

Modified: lyx-devel/trunk/src/Buffer.cpp
==============================================================================
--- lyx-devel/trunk/src/Buffer.cpp      Sat Jan 22 10:27:06 2011        (r37291)
+++ lyx-devel/trunk/src/Buffer.cpp      Sat Jan 22 10:30:03 2011        (r37292)
@@ -3477,13 +3477,14 @@
        runparams.linelen = lyxrc.plaintext_linelen;
        runparams.includeall = includeall;
        vector<string> backs = backends();
+       Converters converters = theConverters();
        if (find(backs.begin(), backs.end(), format) == backs.end()) {
                // Get shortest path to format
-               theConverters().buildGraph();
+               converters.buildGraph();
                Graph::EdgePath path;
                for (vector<string>::const_iterator it = backs.begin();
                     it != backs.end(); ++it) {
-                       Graph::EdgePath p = theConverters().getPath(*it, 
format);
+                       Graph::EdgePath p = converters.getPath(*it, format);
                        if (!p.empty() && (path.empty() || p.size() < 
path.size())) {
                                backend_format = *it;
                                path = p;
@@ -3499,7 +3500,7 @@
                        }
                        return false;
                }
-               runparams.flavor = theConverters().getFlavor(path);
+               runparams.flavor = converters.getFlavor(path);
 
        } else {
                backend_format = format;
@@ -3571,7 +3572,7 @@
        ErrorList & error_list = d->errorLists[error_type];
        string const ext = formats.extension(format);
        FileName const tmp_result_file(changeExtension(filename, ext));
-       bool const success = theConverters().convert(this, FileName(filename),
+       bool const success = converters.convert(this, FileName(filename),
                tmp_result_file, FileName(absFileName()), backend_format, 
format,
                error_list);
 

Reply via email to