mapnik/mapnik — Issue #960: RAII problems in postgis.input
Author: springmeyer
Created: 2011-11-20 23:52:44+00:00
State: open
Labels: postgis.input

When an exception happens in the postgis_datasource constructor, the ~postgis_datasource is never called (because the object was never fully created). Therefore, even if persist_connection=false, the connection pool entry for that datasource is never released. This makes it very difficult to write tests against the postgis datasource where databases need to get cleaned up because even at script exit mapnik's pool will still be holding onto a connection. And likely could signal memory leaks in programs that catch datasource exceptions.