[OpenMap Users] Removing Layer from MapHandler

From: Marc Benstein <MARC.D.BENSTEIN_at_saic.com>
Date: Fri, 16 Sep 2011 16:36:43 -0600

Hi openmap-users,

I am having trouble removing layers from the MapHandler. I have a few
layers that extend OMGraphicHandlerLayer and some that extend Layer. I
add them all to MapHandler using the add(Object) method. However, even
after I remove them using MapHandler.remove(Object) they are still
sitting around leaking memory. I found that if I override dispose() and
call super.dispose() along with setList(null) the layers that extend
OMGraphicHandlerLayer are garbage collected. Unfortunately, the classes
that extend Layer do not get gc'd. They are very simple layers that only
override projectionChanged(ProjectionEvent) and
paintComponent(Graphics). Consequently, dispose() along with
remove(Object) calls do not remove them completely.

I have a suggestion to the maintainers to override dispose() in
OMGraphicHandlerLayer and calling setList(null) along with super.dispose().

How do I _really_ remove the classes that extend Layer from the MapHandler?

Thanks,

-- 
Marc Benstein
505-830-6763
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Sep 16 2011 - 18:38:31 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT