Skip to content

Commit

Permalink
fix memory leak on shader shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
sapier authored and kwolekr committed Apr 8, 2013
1 parent 7a32698 commit 2bdff11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/shader.cpp
Expand Up @@ -388,6 +388,12 @@ ShaderSource::ShaderSource(IrrlichtDevice *device):
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();
}

u32 ShaderSource::getShaderId(const std::string &name)
Expand Down
1 change: 1 addition & 0 deletions src/shader.h
Expand Up @@ -49,6 +49,7 @@ struct ShaderInfo
video::E_MATERIAL_TYPE material;

ShaderInfo(): name(""), material(video::EMT_SOLID) {}
virtual ~ShaderInfo() {}
};

/*
Expand Down

0 comments on commit 2bdff11

Please sign in to comment.