Changeset 14251 in josm for trunk/src


Ignore:
Timestamp:
2018-09-16T01:46:08+02:00 (9 months ago)
Author:
Don-vip
Message:

fix memory leaks after upload, validation and primitives combining

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r14153 r14251  
    539539                dialog.setVisible(true);
    540540                if (!dialog.isApplied()) {
     541                    dialog.dispose();
    541542                    return new UserCancelException();
    542543                }
     
    547548                    cmds.addAll(dialog.buildResolutionCommands());
    548549                }
     550                dialog.dispose();
    549551                return null;
    550552            });
     
    632634        return tr("{0} ({1})", key, values);
    633635    }
     636
     637    @Override
     638    public void dispose() {
     639        setTargetPrimitive(null, false);
     640        super.dispose();
     641    }
    634642}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r13940 r14251  
    409409    @Override
    410410    public void destroy() {
     411        DatasetEventManager.getInstance().removeDatasetListener(this);
    411412        DataSet ds = MainApplication.getLayerManager().getActiveDataSet();
    412413        if (ds != null) {
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r14214 r14251  
    259259    public void setUploadedPrimitives(APIDataSet toUpload) {
    260260        if (toUpload == null) {
    261             List<OsmPrimitive> emptyList = Collections.emptyList();
    262             pnlUploadedObjects.setUploadedPrimitives(emptyList, emptyList, emptyList);
     261            if (pnlUploadedObjects != null) {
     262                List<OsmPrimitive> emptyList = Collections.emptyList();
     263                pnlUploadedObjects.setUploadedPrimitives(emptyList, emptyList, emptyList);
     264            }
    263265            return;
    264266        }
     
    698700    }
    699701
     702    /**
     703     * Clean dialog state and release resources.
     704     * @since 14251
     705     */
     706    public void clean() {
     707        setUploadedPrimitives(null);
     708        pnlBasicUploadSettings = null;
     709        pnlChangesetManagement = null;
     710        pnlTagSettings = null;
     711        pnlUploadedObjects = null;
     712        pnlUploadStrategySelectionPanel = null;
     713        tpConfigPanels = null;
     714        btnUpload = null;
     715        dataSet = null;
     716    }
    700717}
Note: See TracChangeset for help on using the changeset viewer.