]> git.openstreetmap.org Git - nominatim.git/commitdiff
properly close connections to postgres
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 16 Dec 2012 15:23:50 +0000 (16:23 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 16 Dec 2012 15:23:50 +0000 (16:23 +0100)
nominatim/index.c

index f337a9ece5d8560cedc9399de8543f0a8e3e9a07..13f292737082f5a4185c45086b6ff90d265c91eb 100644 (file)
@@ -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)