} 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;
}