diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-07-29 12:53:32 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-07-29 12:53:32 +0100 |
commit | ce4b94ca443909a31a28e4f127dac0348bbedec1 (patch) | |
tree | 425ca967999e2bf14315bb38d0ebc9d10fe204d6 | |
parent | 082f200f5eb1112268d902ce6761a344cdd64fbe (diff) | |
download | libdom-ce4b94ca443909a31a28e4f127dac0348bbedec1.tar.gz |
Clean up nodes and lists
-rw-r--r-- | test/DOMTSHandler.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/DOMTSHandler.pm b/test/DOMTSHandler.pm index 09b657e5..0cf3a56d 100644 --- a/test/DOMTSHandler.pm +++ b/test/DOMTSHandler.pm @@ -1306,6 +1306,7 @@ sub generate_control_statement { print "unsigned int iterator$iterator_index = 0;"; print "foreach_initialise_domnodelist($coll, \&iterator$iterator_index);\n"; print "while(get_next_domnodelist($coll, \&iterator$iterator_index, \&$member)) {\n"; + $self->addto_cleanup($member); } if ($self->{"var"}->{$coll} eq "NamedNodeMap") { @@ -1560,6 +1561,12 @@ sub end_half_assertion { ### Enclose an unsed function ############################################################################################## +sub cleanup_lists { + my ($self, $indent) = @_; + foreach my $list (keys %{$self->{list_map}}) { + print "${indent}if ($list != NULL)\n${indent}\tlist_destroy($list);\n" if ($list ne ''); + } +} sub cleanup_domvar { my ($self, $indent) = @_; @@ -1579,6 +1586,7 @@ sub cleanup { my $self = shift; print "\n\n"; + $self->cleanup_lists("\t"); $self->cleanup_domstring("\t"); $self->cleanup_domvar("\t"); print "\n\tprintf(\"PASS\");\n"; |