summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorVadim Girlin <[email protected]>2013-05-04 22:05:43 +0400
committerVadim Girlin <[email protected]>2013-05-07 04:40:26 +0400
commit46dfad8b36dda80982613a9d29b9a7e99db3abfb (patch)
tree3937e249fc56cc71a8dfd4988a2586db54e84923 /src/gallium
parent1c28e7c5a156fd209fc5cae2b86f416d14b7c4c8 (diff)
r600g/sb: fix memory leaks
Signed-off-by: Vadim Girlin <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r600/sb/sb_bc_parser.cpp3
-rw-r--r--src/gallium/drivers/r600/sb/sb_shader.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
index e1478d380dd..83292874d6b 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
@@ -74,6 +74,8 @@ int bc_parser::parse() {
sh = new shader(ctx, t, bc->debug_id, enable_dump);
int r = parse_shader();
+ delete dec;
+
if (r)
return r;
@@ -94,7 +96,6 @@ int bc_parser::parse() {
prepare_ir();
- delete dec;
return r;
}
diff --git a/src/gallium/drivers/r600/sb/sb_shader.cpp b/src/gallium/drivers/r600/sb/sb_shader.cpp
index 9bda84f32c4..5944ba66f48 100644
--- a/src/gallium/drivers/r600/sb/sb_shader.cpp
+++ b/src/gallium/drivers/r600/sb/sb_shader.cpp
@@ -355,6 +355,11 @@ shader::~shader() {
for (node_vec::iterator I = all_nodes.begin(), E = all_nodes.end();
I != E; ++I)
(*I)->~node();
+
+ for (gpr_array_vec::iterator I = gpr_arrays.begin(), E = gpr_arrays.end();
+ I != E; ++I) {
+ delete *I;
+ }
}
void shader::dump_ir() {