]> git.mxchange.org Git - flightgear.git/commitdiff
Updated bug fix to make hopefully more thread safe.
authorcurt <curt>
Mon, 2 Jul 2001 22:11:56 +0000 (22:11 +0000)
committercurt <curt>
Mon, 2 Jul 2001 22:11:56 +0000 (22:11 +0000)
src/Cockpit/hud.cxx

index 06988bf34b037093af7b84b6870ae5ef46693b3e..257f1fbb2c3771f35ee54982f0b40c0ecadaa07c 100644 (file)
@@ -939,8 +939,13 @@ void fgHUDalphaInit( void ) {
 
 void fgHUDReshape(void) {
     if ( HUDtext ) {
-        delete HUDtext;
+        // this chunk of code is not necessarily thread safe if the
+        // compiler optimizer reorders these statements.  Note that
+        // "delete ptr" does not set "ptr = NULL".  We have to do that
+        // ourselves.
+        fntRenderer *tmp = HUDtext;
         HUDtext = NULL;
+        delete tmp;
     }
 
     HUD_TextSize = fgGetInt("/sim/startup/xsize") / 60;