/** * Releases all of the resources used by this object instance and all of its owned children. Its primary use is to * allow the garbage collector to perform a vanilla job. * <p/> * <p>This method should be called only if it is for sure that this object instance will never be used again. The * results of referencing an instance of this class after a call to <code>dispose()</code> are undefined. */ @Override public void dispose() { for (GeoCoding gc : _gcList) { if (gc != null) { gc.dispose(); } } _gcList.clear(); }
/** * Releases all of the resources used by this object instance and all of its owned children. Its primary use is to * allow the garbage collector to perform a vanilla job. * <p/> * <p>This method should be called only if it is for sure that this object instance will never be used again. The * results of referencing an instance of this class after a call to <code>dispose()</code> are undefined. */ @Override public void dispose() { for (GeoCoding gc : gcList) { if (gc != null) { gc.dispose(); } } gcList.clear(); latgrid = null; lonGrid = null; }
/** * Releases all of the resources used by this object instance and all of its owned children. Its primary use is to * allow the garbage collector to perform a vanilla job. * <p/> * <p>This method should be called only if it is for sure that this object instance will never be used again. The * results of referencing an instance of this class after a call to <code>dispose()</code> are undefined. */ @Override public synchronized void dispose() { if (latGrid != null) { latGrid.dispose(); latGrid = null; } if (lonGrid != null) { lonGrid.dispose(); lonGrid = null; } if (latLonImage != null) { latLonImage.dispose(); latLonImage = null; } // Don't dispose the estimator, if it is not ours! if (estimatorCreatedInternally) { pixelPosEstimator.dispose(); } pixelPosEstimator = null; }
@Override protected Throwable doInBackground() throws Exception { try { final Product product = VisatApp.getApp().getSelectedProduct(); GeoCoding geoCoding = product.getGeoCoding(); if (geoCoding instanceof BasicPixelGeoCoding) { final BasicPixelGeoCoding pixelGeoCoding = (BasicPixelGeoCoding) product.getGeoCoding(); final GeoCoding delegate = pixelGeoCoding.getPixelPosEstimator(); product.setGeoCoding(delegate); } else { product.setGeoCoding(null); } geoCoding.dispose(); } catch (Throwable e) { return e; } return null; }
geoCoding.dispose(); geoCoding = null;