index b98987dd2e53b68ddf828e64c0bb67e61f01bba4..93829ab248dc3992eca7124b1c6a8f95bd035345 100644 (file)
void
sdb_connection_close(sdb_conn_t *conn)
{
+ if (! conn)
+ return;
+
+ /* close the connection even if someone else still references it */
+ if (conn->fd >= 0)
+ close(conn->fd);
+ conn->fd = -1;
+
sdb_object_deref(SDB_OBJ(conn));
} /* sdb_connection_close */