]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment_ctrl.cxx
More fixes to get the code working when threads are disabled.
[flightgear.git] / src / Environment / environment_ctrl.cxx
index f90e28f0d6f97167b0874eab98403c591405041c..d47f8e2d693b75087a2eb9c1bedc08c60d2052fb 100644 (file)
@@ -546,11 +546,13 @@ FGMetarEnvironmentCtrl::fetch_data( const string &icao )
     } catch (const sg_io_exception& e) {
         SG_LOG( SG_GENERAL, SG_WARN, "Error fetching live weather data: "
                 << e.getFormattedMessage().c_str() );
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
         if (_error_count++ >= 3) {
            SG_LOG( SG_GENERAL, SG_WARN, "Stop fetching data permanently.");
            thread->cancel();
            thread->join();
         }
+#endif
 
         result.m = NULL;
     }