Skip to content

Commit

Permalink
Fix leak in test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Dec 2, 2024
1 parent 17d8dfd commit 8621871
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/unit/test_all_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ void check_read_regular(const std::string& file_name, const std::vector<size_t>&
using reference_type = typename testing::MultiDimVector<base_type, traits::rank>::type;

auto file = File(file_name, File::Truncate);
auto expected = testing::copy<reference_type>(traits::create(dims), dims);
auto raw_expected = traits::create(dims);
auto expected = testing::copy<reference_type>(raw_expected, dims);

auto dataspace = DataSpace(dims);
auto attr = testing::AttributeCreateTraits::create<base_type>(file, "dset", dataspace);
Expand All @@ -139,6 +140,7 @@ void check_read_regular(const std::string& file_name, const std::vector<size_t>&
}

testing::ContainerTraits<reference_type>::deallocate(expected, dims);
testing::ContainerTraits<Container>::deallocate(raw_expected, dims);
}

template <class Container>
Expand Down

0 comments on commit 8621871

Please sign in to comment.