{
m_env->removePlayerName(m_name.c_str());
}
+ removeFromScene(true);
}
core::aabbox3d<f32>* GenericCAO::getSelectionBox()
void GenericCAO::removeFromScene(bool permanent)
{
- if(permanent) // Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
+ if((m_env != 0) && (permanent)) // Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
{
for(std::vector<u16>::iterator ci = m_children.begin();
ci != m_children.end(); ci++)
ShaderSource::~ShaderSource()
{
- //m_shader_callback->drop();
-
for (std::vector<IShaderConstantSetter*>::iterator iter = m_global_setters.begin();
iter != m_global_setters.end(); iter++) {
delete *iter;
}
m_global_setters.clear();
+
+ if (m_shader_callback) {
+ m_shader_callback->drop();
+ m_shader_callback = NULL;
+ }
}
u32 ShaderSource::getShader(const std::string &name,