summaryrefslogtreecommitdiffstats
path: root/src/afb-session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/afb-session.c')
-rw-r--r--src/afb-session.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/afb-session.c b/src/afb-session.c
index dfa383b1..c23d414b 100644
--- a/src/afb-session.c
+++ b/src/afb-session.c
@@ -428,7 +428,6 @@ end:
struct afb_session *afb_session_addref(struct afb_session *session)
{
if (session != NULL) {
- afb_hook_session_unref(session);
afb_hook_session_addref(session);
session->refcount++;
session_unlock(session);
@@ -444,7 +443,7 @@ void afb_session_unref(struct afb_session *session)
session_lock(session);
afb_hook_session_unref(session);
- if (!--session->refcount) {
+ if (--session->refcount) {
if (session->autoclose)
session_close(session);
if (session->notinset) {