From: Sarah Hoffmann Date: Sun, 16 Dec 2012 15:23:50 +0000 (+0100) Subject: properly close connections to postgres X-Git-Tag: v2.2.0~155 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/89af9171055267a87bcdab3a36ba630390664617 properly close connections to postgres --- diff --git a/nominatim/index.c b/nominatim/index.c index f337a9ec..13f29273 100644 --- a/nominatim/index.c +++ b/nominatim/index.c @@ -308,6 +308,13 @@ void nominatim_index(int rank_min, int rank_max, int num_threads, const char *co { nominatim_exportXMLEnd(writer); } + + // Close all connections + for (i = 0; i < num_threads; i++) + { + PQfinish(thread_data[i].conn); + } + PQfinish(conn); } void *nominatim_indexThread(void * thread_data_in)