Skip to content

Commit

Permalink
Sync the branch graph on project saving
Browse files Browse the repository at this point in the history
* Since 8642393 the branch graph is not necessarily rebuilt on project loading. It may however be out of sync at the time of project writing, if e.g. points have been deleted with no branch graph sync after that

* In order to achieve a consistent situation the branch graph is synced before saving. It is actually only synced, if it was found to be outdated.
  • Loading branch information
stefanhahmann authored and tinevez committed Nov 5, 2024
1 parent 6856888 commit 24e72f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/mastodon/mamut/io/ProjectSaver.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ public static synchronized void saveProject( final File saveTo, final ProjectMod
try (final MamutProject.ProjectWriter writer = project.openForWriting())
{
MamutProjectIO.save( project, writer );
// Synchronize branch graph with main graph before saving. This is required to make saved state consistent.
appModel.getBranchGraphSync().sync();
final Model model = appModel.getModel();
// Save Raw Graph Model
final GraphToFileIdMap< Spot, Link > idmap = model.saveRaw( writer );
// Serialize feature model.
MamutRawFeatureModelIO.serialize( appModel.getContext(), model, idmap, writer );
Expand Down

0 comments on commit 24e72f5

Please sign in to comment.