projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a32698
)
fix memory leak on shader shutdown
author
sapier
<Sapier at GMX dot net>
Sun, 7 Apr 2013 19:42:54 +0000
(21:42 +0200)
committer
kwolekr
<kwolekr@minetest.net>
Mon, 8 Apr 2013 02:30:29 +0000
(22:30 -0400)
src/shader.cpp
patch
|
blob
|
history
src/shader.h
patch
|
blob
|
history
diff --git
a/src/shader.cpp
b/src/shader.cpp
index a224c82bb271eda6053f0e57f382c618b4ff9772..62b7c99a936f71d0bd7081b6b3e852a4613e64a0 100644
(file)
--- a/
src/shader.cpp
+++ b/
src/shader.cpp
@@
-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)
diff --git
a/src/shader.h
b/src/shader.h
index a7367eaff46a3895674382501bc8b32aaa16c46c..a62569602e1ac94dc3c329edda3a2be01841b05f 100644
(file)
--- a/
src/shader.h
+++ b/
src/shader.h
@@
-49,6
+49,7
@@
struct ShaderInfo
video::E_MATERIAL_TYPE material;
ShaderInfo(): name(""), material(video::EMT_SOLID) {}
+ virtual ~ShaderInfo() {}
};
/*