Ignore:
Timestamp:
2020-10-10T11:48:49+02:00 (4 years ago)
Author:
GerdP
Message:

see #19885: memory leak with "temporary" objects in validator and actions
next bunch of changes:

  • use ChangeNodesCommand instead of ChangeCommand
  • further simplifications
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r16436 r17141  
    2222
    2323import org.openstreetmap.josm.command.AddCommand;
    24 import org.openstreetmap.josm.command.ChangeCommand;
     24import org.openstreetmap.josm.command.ChangeNodesCommand;
    2525import org.openstreetmap.josm.command.Command;
    2626import org.openstreetmap.josm.data.coor.EastNorth;
     
    231231
    232232        for (int pos = 0; pos < ways.size(); pos++) {
    233             if (!changedWays[pos]) {
    234                 continue;
    235             }
    236 
    237             Way way = ways.get(pos);
    238             Way newWay = new Way(way);
    239             newWay.setNodes(newNodes[pos]);
    240 
    241             cmds.add(new ChangeCommand(dataset, way, newWay));
     233            if (changedWays[pos]) {
     234                cmds.add(new ChangeNodesCommand(dataset, ways.get(pos), newNodes[pos]));
     235            }
    242236        }
    243237
Note: See TracChangeset for help on using the changeset viewer.