Ignore:
Timestamp:
2017-06-09T21:31:00+02:00 (9 years ago)
Author:
michael2402
Message:

Fix listener leak in ChangesetDialog and migrate ChangesetInSelectionListModel to new dataset listeners.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r12297 r12373  
    4343import org.openstreetmap.josm.data.osm.event.DatasetEventManager;
    4444import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
     45import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    4546import org.openstreetmap.josm.gui.SideButton;
    4647import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager;
     
    113114        // let the model for changesets in the current selection listen to various events
    114115        ChangesetCache.getInstance().addChangesetCacheListener(inSelectionModel);
    115         Main.getLayerManager().addActiveLayerChangeListener(inSelectionModel);
    116         DataSet.addSelectionListener(inSelectionModel);
     116        SelectionEventManager.getInstance().addSelectionListener(inSelectionModel);
    117117
    118118        // let the model for changesets in the current layer listen to various
     
    140140        // remove the list model for the changesets in the current selection as
    141141        // listener
    142         //
    143         Main.getLayerManager().removeActiveLayerChangeListener(inSelectionModel);
    144         DataSet.removeSelectionListener(inSelectionModel);
     142        SelectionEventManager.getInstance().removeSelectionListener(inSelectionModel);
     143        ChangesetCache.getInstance().removeChangesetCacheListener(inSelectionModel);
    145144    }
    146145
Note: See TracChangeset for help on using the changeset viewer.