Skip to content

Commit

Permalink
Killed some memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel committed Nov 27, 2011
1 parent 04c340b commit 0fee2c5
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/cgalpngtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ int main(int argc, char **argv)
csgInfo.glview->paintGL();
csgInfo.glview->save(outfile);

delete root_node;
delete root_module;

Builtins::instance(true);

return 0;
Expand Down
4 changes: 4 additions & 0 deletions tests/csgtermtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ int main(int argc, char **argv)
}
outfile.close();

if (root_term) root_term->unlink();
delete root_node;
delete root_module;

Builtins::instance(true);

return rc;
Expand Down
3 changes: 3 additions & 0 deletions tests/csgtestcore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)

csgInfo.glview->save(outfilename);

delete root_node;
delete root_module;

Builtins::instance(true);

return 0;
Expand Down
3 changes: 3 additions & 0 deletions tests/csgtexttest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ int main(int argc, char **argv)
outfile << csgcache[*root_node] << "\n";
outfile.close();

delete root_node;
delete root_module;

Builtins::instance(true);

return rc;
Expand Down
6 changes: 6 additions & 0 deletions tests/dumptest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ int main(int argc, char **argv)
outfile << dumpstdstr << "\n";
outfile.close();

delete root_node;
delete root_module;

root_module = parsefile(outfilename);
if (!root_module) {
fprintf(stderr, "Error: Unable to read back dumped file\n");
Expand All @@ -159,6 +162,9 @@ int main(int argc, char **argv)
exit(1);
}

delete root_node;
delete root_module;

Builtins::instance(true);

return rc;
Expand Down
3 changes: 3 additions & 0 deletions tests/echotest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ int main(int argc, char **argv)
AbstractNode::resetIndexCounter();
root_node = root_module->evaluate(&root_ctx, &root_inst);

delete root_node;
delete root_module;

Builtins::instance(true);
ofile.close();
return rc;
Expand Down
11 changes: 11 additions & 0 deletions valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@
fun:(below main)
}

{
Qt misc leaks
Memcheck:Leak
fun:calloc
...
fun:_Z7qt_initP19QApplicationPrivatei
fun:_ZN19QApplicationPrivate9constructEv
fun:_ZN12QApplicationC2ERiPPcbi
fun:main
}

0 comments on commit 0fee2c5

Please sign in to comment.