Skip to content

Commit

Permalink
Fix issue when clearing a Lst<Mixed> in an upgraded file (#7806)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo authored Jun 13, 2024
1 parent 8da33a3 commit b576cbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* Valgrind could report a branch on an uninitialized read when opening something that is not an encrypted Realm file as an encrypted Realm file ([PR #7789](https://github.com/realm/realm-core/pull/7789), since v14.10.0).
* Opening an FLX realm asynchronously may not wait to download all data ([#7720](https://github.com/realm/realm-core/issues/7720), since FLX sync was introduced).
* Clearing a List of Mixed in an upgraded file would lead to an assertion failing ([#7771](https://github.com/realm/realm-core/issues/7771), since 14.0.0)
* Fix compilation with Xcode 16 ([PR #7802](https://github.com/realm/realm-core/pull/7802))

### Breaking changes
Expand Down
4 changes: 3 additions & 1 deletion src/realm/array_mixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ void ArrayMixed::clear()
Array::set(payload_idx_int, 0);
Array::set(payload_idx_pair, 0);
Array::set(payload_idx_str, 0);
Array::set(payload_idx_ref, 0);
if (Array::size() > payload_idx_ref) {
Array::set(payload_idx_ref, 0);
}
if (Array::size() > payload_idx_key) {
if (auto ref = Array::get_as_ref(payload_idx_key)) {
Array::destroy(ref, m_composite.get_alloc());
Expand Down

0 comments on commit b576cbc

Please sign in to comment.