Skip to content

Commit

Permalink
Clear Zarr::acquisition_dimensions_ before setting (#241)
Browse files Browse the repository at this point in the history
In case we reuse the Zarr storage object, we want this to be empty
before we start appending.
  • Loading branch information
aliddell authored Apr 22, 2024
1 parent 901c3e4 commit e6abd82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.11](https://github.com/acquire-project/acquire-driver-zarr/compare/v0.1.10..v0.1.11) - 2024-04-22

### Fixed

- Acquisition dimensions can be reconfigured without causing a crash.

## [0.1.10](https://github.com/acquire-project/acquire-driver-zarr/compare/v0.1.9..v0.1.10) - 2024-03-29

### Added
Expand Down
2 changes: 2 additions & 0 deletions src/zarr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ zarr::Zarr::set_dimensions_(const StorageProperties* props)
const auto dimension_count = props->acquisition_dimensions.size;
EXPECT(dimension_count > 2, "Expected at least 3 dimensions.");

acquisition_dimensions_.clear();

for (auto i = 0; i < dimension_count; ++i) {
CHECK(props->acquisition_dimensions.data[i].name.str);
Dimension dim(props->acquisition_dimensions.data[i]);
Expand Down

0 comments on commit e6abd82

Please sign in to comment.