]> git.mxchange.org Git - simgear.git/commitdiff
ref() the cloud states before use so that if we are dyanmically creating and
authorcurt <curt>
Wed, 2 Oct 2002 16:03:25 +0000 (16:03 +0000)
committercurt <curt>
Wed, 2 Oct 2002 16:03:25 +0000 (16:03 +0000)
deleting cloud layers we don't inadvertantly delete a cloud state.

simgear/scene/sky/cloud.cxx

index 687f8d64bd5da36403cba453359a16c77f643cce..74fd99e6cad1b15d7cd34e9fad0e6f9f9719d6dd 100644 (file)
@@ -368,5 +368,9 @@ ssgSimpleState *SGCloudMakeState( const string &path ) {
     state->enable( GL_ALPHA_TEST );
     state->setAlphaClamp( 0.01 );
 
+    // ref() the state so it doesn't get deleted if the last layer of
+    // it's type is deleted.
+    state->ref();
+
     return state;
 }