Skip to content

Commit

Permalink
free memory used by extraAttrs, closes #135
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldsmith committed Aug 14, 2023
1 parent fbd0f63 commit db66439
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions OpenEXR_CTL/exr_ctl_exr/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,15 @@ main(int argc, char **argv)
exitStatus = 1;
}

// clean up dynamically allocated memory
if(extraAttrs.size() > 0)
{
for(AttrMap::iterator it=extraAttrs.begin() ; it!=extraAttrs.end() ; it++)
{
delete it->second;
}
}
extraAttrs.clear();

return exitStatus;
}
2 changes: 1 addition & 1 deletion resources/test/scripts/run_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ test_21_label="exr_ctl_exr"

valgrind -s --error-exitcode=1 --leak-check=full --track-origins=yes --show-leak-kinds=all ../../OpenEXR_CTL/exr_ctl_exr/exr_ctl_exr -C change_saturation -float sScale 1.2 ../../../unittest/exr_ctl_exr/marci-512.exr ./output/exr_ctl_exr-sScale-1.2.exr
test_22_status=$?
test_22_label="exr_ctl_exr"
test_22_label="exr_ctl_exr-float"

# go back to initial path
cd $SCRIPTPATH
Expand Down

0 comments on commit db66439

Please sign in to comment.