Updated bug fix to make hopefully more thread safe.
This commit is contained in:
parent
b985e348da
commit
5d2855f1ec
1 changed files with 6 additions and 1 deletions
|
@ -939,8 +939,13 @@ void fgHUDalphaInit( void ) {
|
||||||
|
|
||||||
void fgHUDReshape(void) {
|
void fgHUDReshape(void) {
|
||||||
if ( HUDtext ) {
|
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;
|
HUDtext = NULL;
|
||||||
|
delete tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
HUD_TextSize = fgGetInt("/sim/startup/xsize") / 60;
|
HUD_TextSize = fgGetInt("/sim/startup/xsize") / 60;
|
||||||
|
|
Loading…
Add table
Reference in a new issue