]> git.mxchange.org Git - flightgear.git/commitdiff
Fix up environment code for threading-enabled case, d'oh.
authorjmt <jmt>
Fri, 26 Dec 2008 15:33:38 +0000 (15:33 +0000)
committerjmt <jmt>
Fri, 26 Dec 2008 15:33:38 +0000 (15:33 +0000)
src/Environment/environment_ctrl.cxx

index 8fb0ad8fea53b57073ee4b8bc483dc547e720ae8..1331a2c325d3bc7475e17c405dc680a153993887 100644 (file)
@@ -964,7 +964,7 @@ FGMetarEnvironmentCtrl::update_metar_properties( const FGMetar *m )
 void
 FGMetarEnvironmentCtrl::thread_stop()
 {
-    request_queue.push( string() );    // ask thread to terminate
+    request_queue.push(NULL);  // ask thread to terminate
     thread->join();
 }
 
@@ -973,11 +973,11 @@ FGMetarEnvironmentCtrl::MetarThread::run()
 {
     while ( true )
     {
-        string icao = fetcher->request_queue.pop();
-        if (icao.empty())
+        FGAirport* apt = fetcher->request_queue.pop();
+        if (!apt)
             return;
-        SG_LOG( SG_GENERAL, SG_INFO, "Thread: fetch metar data = " << icao );
-        FGMetarResult result = fetcher->fetch_data( icao );
+        SG_LOG( SG_GENERAL, SG_INFO, "Thread: fetch metar data = " << apt->ident() );
+        FGMetarResult result = fetcher->fetch_data( apt );
         fetcher->result_queue.push( result );
     }
 }