mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: remember deleted trip in UndoRemoveDivesFromTrip::undo()
If the last dive of a trip is removed, the trip is deleted. On redo the dive is added to a non existing trip, leading to a segfault. Therefore, keep a copy of the trip to reinstate it on redo. Note: this cannot work for a sequence of multiple commands. One would have to rewrite the whole undo-history. Nevertheless, let's do this as a stop-gap measure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b51e616b6a
commit
325b8bba35
4 changed files with 33 additions and 8 deletions
|
|
@ -507,6 +507,7 @@ extern void delete_single_dive(int idx);
|
|||
extern void add_single_dive(int idx, struct dive *dive);
|
||||
|
||||
extern void insert_trip(dive_trip_t **trip);
|
||||
extern struct dive_trip *clone_empty_trip(struct dive_trip *trip);
|
||||
|
||||
|
||||
extern const struct units SI_units, IMPERIAL_units;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue