]> git.mxchange.org Git - flightgear.git/commitdiff
Added ref() count increment calls to all ssgSimpleState creation to prevent
authorcurt <curt>
Wed, 18 Oct 2000 00:48:12 +0000 (00:48 +0000)
committercurt <curt>
Wed, 18 Oct 2000 00:48:12 +0000 (00:48 +0000)
them from being delete by ssg once nothing in the scene graph points to them.

src/Main/main.cxx
src/Objects/newmat.cxx

index f15de36101fa34de627d9eaf362dd35174c18a5e..67e4aa02cd1564d2ea35b4ef686ba396e297174e 100644 (file)
@@ -199,6 +199,7 @@ ssgSimpleState *menus;
 
 void fgBuildRenderStates( void ) {
     default_state = new ssgSimpleState;
+    default_state->ref();
     default_state->disable( GL_TEXTURE_2D );
     default_state->enable( GL_CULL_FACE );
     default_state->enable( GL_COLOR_MATERIAL );
@@ -210,12 +211,14 @@ void fgBuildRenderStates( void ) {
     default_state->disable( GL_LIGHTING );
 
     hud_and_panel = new ssgSimpleState;
+    hud_and_panel->ref();
     hud_and_panel->disable( GL_CULL_FACE );
     hud_and_panel->disable( GL_TEXTURE_2D );
     hud_and_panel->disable( GL_LIGHTING );
     hud_and_panel->enable( GL_BLEND );
 
     menus = new ssgSimpleState;
+    menus->ref();
     menus->disable( GL_CULL_FACE );
     menus->disable( GL_TEXTURE_2D );
     menus->enable( GL_BLEND );
index d9e7539869745651c779ddae6db573db24dadc38..f6d3ec53ab6ee4089548e619a017036879c3695e 100644 (file)
@@ -75,8 +75,12 @@ void FGNewMat::build_ssg_state( const string& path,
     tex_file.append( texture_name );
 
     state = new ssgStateSelector(2);
+
     textured = new ssgSimpleState();
+    textured->ref();
+
     nontextured = new ssgSimpleState();
+    nontextured->ref();
 
     // Set up the textured state
     textured->setShadeModel( shade_model );
@@ -130,7 +134,9 @@ void FGNewMat::build_ssg_state( const string& path,
 void FGNewMat::set_ssg_state( ssgSimpleState *s ) {
     state = new ssgStateSelector(2);
     textured = s;
+
     nontextured = new ssgSimpleState();
+    nontextured->ref();
 
     // Set up the coloured state
     nontextured->enable( GL_LIGHTING );