summaryrefslogtreecommitdiffstats
path: root/commands/command_divelist.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-13 12:17:43 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-13 08:52:48 -0700
commit103951bc78485beb615feafd1f3d8e7aac3120ea (patch)
treead0fc3b8ab2f7258c5658b56f5c76a11f388d7fe /commands/command_divelist.cpp
parent3d4412ad1a346d80959cd78395703636d9127699 (diff)
downloadsubsurface-103951bc78485beb615feafd1f3d8e7aac3120ea.tar.gz
divelist: when removing/adding a dive unregister/register fulltext
This fixes a crash: when the undo commands removed a dive from the list, the fulltext cache was not cleared. If now the divelist is reset and then the undo-command deleted, deletion of the owned dive tries to remove it's fulltext cache, which doesn't exist anymore. For reasons of symmetry, when readding the dive, its fulltext has to be registered. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command_divelist.cpp')
-rw-r--r--commands/command_divelist.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/commands/command_divelist.cpp b/commands/command_divelist.cpp
index 8f6189c1e..fe59ecb6c 100644
--- a/commands/command_divelist.cpp
+++ b/commands/command_divelist.cpp
@@ -73,6 +73,7 @@ dive *DiveListBase::addDive(DiveToAdd &d)
res->hidden_by_filter = true;
int idx = dive_table_get_insertion_index(&dive_table, res);
+ fulltext_register(res); // Register the dive's fulltext cache
add_to_dive_table(&dive_table, idx, res); // Return ownership to backend
invalidate_dive_cache(res); // Ensure that dive is written in git_save()