/** * 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. * <p/> * <p>Overrides of this method should always call <code>super.dispose();</code> after disposing this instance. */ @Override public void dispose() { if (attributes != null) { attributes.dispose(); attributes = null; } if (elements != null) { elements.dispose(); elements = null; } super.dispose(); }
@Override public synchronized void dispose() { if (getProduct() != null) { getProduct().removeProductNodeListener(listener); } placemarkMap.clear(); super.dispose(); }