diff --git a/panda/src/pgraph/renderState.cxx b/panda/src/pgraph/renderState.cxx index 21a72d398f..f85e961f3b 100644 --- a/panda/src/pgraph/renderState.cxx +++ b/panda/src/pgraph/renderState.cxx @@ -692,6 +692,7 @@ clear_cache() { if (state->_self_compose != (RenderState *)NULL && state->_self_compose != state) { unref_delete((RenderState *)state->_self_compose); + state->_self_compose = (RenderState *)NULL; } } diff --git a/panda/src/pgraph/transformState.cxx b/panda/src/pgraph/transformState.cxx index fce4db953b..44c1eb6b74 100644 --- a/panda/src/pgraph/transformState.cxx +++ b/panda/src/pgraph/transformState.cxx @@ -723,6 +723,7 @@ clear_cache() { if (state->_self_compose != (TransformState *)NULL && state->_self_compose != state) { unref_delete((TransformState *)state->_self_compose); + state->_self_compose = (TransformState *)NULL; } }