From: curt Date: Wed, 2 Oct 2002 16:03:25 +0000 (+0000) Subject: ref() the cloud states before use so that if we are dyanmically creating and X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5c61e9735825d0f1514c0e822972c3dbe78539f8;p=simgear.git ref() the cloud states before use so that if we are dyanmically creating and deleting cloud layers we don't inadvertantly delete a cloud state. --- diff --git a/simgear/scene/sky/cloud.cxx b/simgear/scene/sky/cloud.cxx index 687f8d64..74fd99e6 100644 --- a/simgear/scene/sky/cloud.cxx +++ b/simgear/scene/sky/cloud.cxx @@ -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; }