Skip to content

Commit

Permalink
Fix garbage collection
Browse files Browse the repository at this point in the history
The WindowManager needs to take care that the dialogs are properly
disposed.
  • Loading branch information
maarzt authored and tinevez committed Dec 21, 2023
1 parent 940e8d0 commit 878a1c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/mastodon/mamut/WindowManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,18 @@ public WindowManager( final ProjectModel appModel )
settings.addPage( new FeatureColorModeConfigPage( "Settings > Feature Color Modes", featureColorModeManager,
featureProjectionsManager, "Spot", "Link" ) );
settings.pack();
appModel.projectClosedListeners().add( settings::dispose );

/*
* Tag-set and feature computation dialogs
*/
tagSetDialog = new TagSetDialog( null, model.getTagSetModel(), model, keymap, new String[] { KeyConfigContexts.MASTODON } );
tagSetDialog.setIconImages( TAGS_ICON );
appModel.projectClosedListeners().add( tagSetDialog::dispose );

featureComputationDialog = MamutFeatureComputation.getDialog( appModel, context );
featureComputationDialog.setIconImages( FEATURES_ICON );
appModel.projectClosedListeners().add( featureComputationDialog::dispose );

/*
* Register windows.
Expand Down

0 comments on commit 878a1c4

Please sign in to comment.