From be5fdae0b2180b3e48501a05d4e1db497369d394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Edelbo?= Date: Tue, 18 Jun 2024 12:40:22 +0200 Subject: [PATCH] Also fix Lst::clear() --- src/realm/list.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/realm/list.cpp b/src/realm/list.cpp index d3f94bd895a..4c26ec48089 100644 --- a/src/realm/list.cpp +++ b/src/realm/list.cpp @@ -503,10 +503,11 @@ void Lst::remove(size_t from, size_t to) void Lst::clear() { - if (size() > 0) { - if (Replication* repl = Base::get_replication()) { - repl->list_clear(*this); - } + auto sz = size(); + if (Replication* repl = Base::get_replication()) { + repl->list_clear(*this); + } + if (sz > 0) { CascadeState state; bool recurse = remove_backlinks(state);