summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 873f760)
raw | patch | inline | side by side (parent: 873f760)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 11 Apr 2014 07:18:28 +0000 (09:18 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 11 Apr 2014 07:18:28 +0000 (09:18 +0200) |
Previously, it would still be kept open if someone else referenced the object.
src/frontend/connection.c | patch | blob | history |
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 */