summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 72a63cf)
raw | patch | inline | side by side (parent: 72a63cf)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 11 Apr 2014 07:13:55 +0000 (09:13 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 11 Apr 2014 07:13:55 +0000 (09:13 +0200) |
Previously, the ownership was not taken away from the thread-specific data
aftter removing the connection from the current context, thus leaking each
connection object.
aftter removing the connection from the current context, thus leaking each
connection object.
src/frontend/connection.c | patch | blob | history |
index 69c71edbd3e6f7ac9e5876841d9237f738267ab5..1fa4ba98c6888a726f8e921cce82f9d7e1d8900a 100644 (file)
static void
sdb_conn_set_ctx(sdb_conn_t *conn)
{
+ sdb_conn_t *old;
+
sdb_conn_ctx_init();
+
+ old = pthread_getspecific(conn_ctx_key);
+ if (old)
+ sdb_object_deref(SDB_OBJ(old));
if (conn)
sdb_object_ref(SDB_OBJ(conn));
pthread_setspecific(conn_ctx_key, conn);