[mapserver-dev] layer vtable method LayerCloseConnection causing leaks

thomas bonfort thomas.bonfort at gmail.com
Wed Sep 19 04:08:08 PDT 2012


Devs,

The layer vtable has an entry for LayerCloseConnection which I assume
would be used in case the driver is providing connection pooling
itself. However the postgis, uvraster and rasterquery drivers are
pointing this entry to their regular LayerClose method, which is
leading to memory leaks.

In freeMap, msCloseConnections() is called, which trickles down to
vtable->LayerClose() for those three drivers.
Later on in freeMap when looping through the layers, layerIsOpen
returns false, so msLayerClose() is not called, which causes a leak as
msLayerClose does more than just call vtable->layerClose().

I'm committing a fix to disable LayerCloseConnection for these
drivers, but would appreciate if someone more knowledgeable than me in
this area can give a thumbs up. The oracle driver very probably needs
the same treatment, but am leaving this to the oracle maintainer as am
not setup to test side-effects on that driver.

regards,
thomas


More information about the mapserver-dev mailing list