Hi!

We are using the class MapContent together with the StreamingRenderer to
render a bunch of different layers. This works fine, but now we want to
render the same layers with a second MapContent. The problem is that when
calling `dispose()` on the first MapContent, that also all layers are
disposed and the data sources are closed. So that the layers can not be
used anymore in a second MapContent.

I could simply skip the call to `MapContent.dispose()` and then dispose the
layers manually at the end. But this shows the error message "Call
MapContent dispose() to prevent memory leaks", which I do not want to show
to the users of our library.

For now, I sub-classed MapContent and overwrite `dispose()` and
`finalize()`, but this feels like a hack. What else could I do? Why are
layers disposed when disposing MapContent?

Thanks,
Tobias
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to