Test for null object after load before trying to connect it into the scene
graph (which would cause a crash.)
This commit is contained in:
parent
b2f604ad00
commit
35533b3a8d
1 changed files with 4 additions and 2 deletions
|
@ -370,8 +370,10 @@ int FGTileMgr::update( double lon, double lat ) {
|
|||
ssgTexturePath( (char *)(dm->get_texture_path().c_str()) );
|
||||
ssgEntity *obj_model
|
||||
= ssgLoad( (char *)(dm->get_model_path().c_str()) );
|
||||
dm->get_obj_trans()->addKid( obj_model );
|
||||
dm->get_tile()->dec_pending_models();
|
||||
if ( obj_model != NULL ) {
|
||||
dm->get_obj_trans()->addKid( obj_model );
|
||||
}
|
||||
dm->get_tile()->dec_pending_models();
|
||||
|
||||
delete dm;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue