From 5c61e9735825d0f1514c0e822972c3dbe78539f8 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 2 Oct 2002 16:03:25 +0000 Subject: [PATCH] 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. --- simgear/scene/sky/cloud.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.39.5