diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 76f634c3b2..1a9373aa99 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -126,7 +126,7 @@ void setAscentFractions(vector & ascent_fractions, std::function FindFirst(string const & comp) { - return [comp](SnippetPair const & sp) { return sp.first == comp; }; + return [&comp](SnippetPair const & sp) { return sp.first == comp; }; } @@ -321,7 +321,7 @@ namespace { std::function IncrementedFileName (string const & to_format, string const & filename_base) { - return [to_format, filename_base](string const & snippet) + return [&to_format, &filename_base](string const & snippet) { static int counter_ = 1; ostringstream os; @@ -478,7 +478,7 @@ namespace { std::function FindSnippet(string const & s) { - return [s](InProgressProcess const & process) { + return [&s](InProgressProcess const & process) { BitmapFile const & snippets = process.second.snippets; BitmapFile::const_iterator beg = snippets.begin(); BitmapFile::const_iterator end = snippets.end(); @@ -531,7 +531,7 @@ void PreviewLoader::Impl::add(string const & latex_snippet) namespace { std::function EraseSnippet(string const & s) { - return [s](InProgressProcess & process) { + return [&s](InProgressProcess & process) { BitmapFile & snippets = process.second.snippets; BitmapFile::iterator it = snippets.begin(); BitmapFile::iterator end = snippets.end();