Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Pitiot
CGoGN
Commits
19384357
Commit
19384357
authored
Aug 14, 2012
by
Sylvain Thery
Browse files
Remove last memory leadk (clean with valgrind now)
parent
cbaa11ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/Container/attributeContainer.hpp
View file @
19384357
...
...
@@ -149,7 +149,7 @@ bool AttributeContainer::removeAttribute(const std::string& attribName)
if
(
index
==
UNKNOWN
)
{
std
::
cerr
<<
"removeAttribute by name: attribute not found
"
<<
std
::
endl
;
std
::
cerr
<<
"removeAttribute by name: attribute not found
("
<<
attribName
<<
")"
<<
std
::
endl
;
return
false
;
}
...
...
src/Container/attributeContainer.cpp
View file @
19384357
...
...
@@ -48,6 +48,18 @@ AttributeContainer::AttributeContainer() :
AttributeContainer
::~
AttributeContainer
()
{
for
(
unsigned
int
index
=
0
;
index
<
m_tableAttribs
.
size
();
++
index
)
{
if
(
m_tableAttribs
[
index
]
!=
NULL
)
delete
m_tableAttribs
[
index
];
}
for
(
unsigned
int
index
=
0
;
index
<
m_holesBlocks
.
size
();
++
index
)
{
if
(
m_holesBlocks
[
index
]
!=
NULL
)
delete
m_holesBlocks
[
index
];
}
}
/**************************************
...
...
src/Utils/GLSLShader.cpp
View file @
19384357
...
...
@@ -207,6 +207,7 @@ bool GLSLShader::loadVertexShader( const std::string& filename )
if
(
m_vertex_shader_source
)
delete
[]
m_vertex_shader_source
;
m_vertex_shader_source
=
NULL
;
m_vertex_shader_source
=
loadSourceFile
(
filename
);
...
...
@@ -230,6 +231,7 @@ bool GLSLShader::loadFragmentShader(const std::string& filename )
if
(
m_fragment_shader_source
)
delete
[]
m_fragment_shader_source
;
m_fragment_shader_source
=
NULL
;
m_fragment_shader_source
=
loadSourceFile
(
filename
);
...
...
@@ -586,6 +588,13 @@ GLSLShader::~GLSLShader()
glDeleteObjectARB
(
m_program_object
);
}
if
(
m_vertex_shader_source
!=
NULL
)
delete
[]
m_vertex_shader_source
;
if
(
m_fragment_shader_source
!=
NULL
)
delete
[]
m_fragment_shader_source
;
if
(
m_geom_shader_source
!=
NULL
)
delete
[]
m_geom_shader_source
;
// m_registeredShaders.erase(this);
}
...
...
@@ -702,6 +711,7 @@ bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs)
{
if
(
m_vertex_shader_source
)
delete
[]
m_vertex_shader_source
;
m_vertex_shader_source
=
NULL
;
unsigned
int
sz
=
strlen
(
vs
);
m_vertex_shader_source
=
new
char
[
sz
+
1
];
...
...
@@ -730,9 +740,11 @@ bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs, const cha
{
if
(
m_vertex_shader_source
)
delete
[]
m_vertex_shader_source
;
m_vertex_shader_source
=
NULL
;
unsigned
int
sz
=
strlen
(
vs
);
m_vertex_shader_source
=
new
char
[
sz
+
1
];
strcpy
(
m_vertex_shader_source
,
vs
);
if
(
m_fragment_shader_source
)
...
...
@@ -771,9 +783,11 @@ bool GLSLShader::reloadVertexShaderFromMemory(const char* vs)
{
if
(
m_vertex_shader_source
)
delete
[]
m_vertex_shader_source
;
m_vertex_shader_source
=
NULL
;
unsigned
int
sz
=
strlen
(
vs
);
m_vertex_shader_source
=
new
char
[
sz
+
1
];
strcpy
(
m_vertex_shader_source
,
vs
);
return
true
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment