[Tile-serving] [openstreetmap/osm2pgsql] Make sure PostgreSQL connection is cleaned up properly. (#1013)

Jochen Topf notifications at github.com
Wed Dec 4 08:41:23 UTC 2019


PQfinish(m_conn) must also be called if the connection attempt fails.
By wrapping this into a unique_ptr with deleter, the code becomes
simpler, none of the special member functions is needed any more.

This also adds a little convenience function error_msg() which makes the
rest of the code somewhat cleaner.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/1013

-- Commit Summary --

  * Make sure PostgreSQL connection is cleaned up properly.

-- File Changes --

    M src/pgsql.cpp (33)
    M src/pgsql.hpp (18)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/1013.patch
https://github.com/openstreetmap/osm2pgsql/pull/1013.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20191204/36721bc5/attachment.html>


More information about the Tile-serving mailing list