commit f323a64fc34b83268b769fe549d1bc5801dd19b3
Author: Enrico Forestieri <[email protected]>
Date:   Mon Aug 15 03:22:01 2016 +0200

    Adapt code to comment
---
 src/graphics/PreviewLoader.cpp |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index f3bf437..e9b1d47 100644
--- a/src/graphics/PreviewLoader.cpp
+++ b/src/graphics/PreviewLoader.cpp
@@ -103,13 +103,11 @@ lyx::Converter const * setConverter(string const & from)
                });
 #else
        // This is also thread-safe according to ยง6.7.4 of the C++11 standard.
-       static bool first = true;
-       if (first) {
-               first = false;
-               LYXERR0("PreviewLoader::startLoading()\n"
-                       << "No converter from \"" << from
-                       << "\" format has been defined.");
-       }
+       static bool once = ([&]{
+                       LYXERR0("PreviewLoader::startLoading()\n"
+                               << "No converter from \"" << from
+                               << "\" format has been defined.");
+               } (), true);
 #endif
        return 0;
 }

Reply via email to