The transport connection should only be dropped once all references to
the session are released otherwise some pending operations may not be
processed and the session will not be freed.
if (refs > 0)
return;
+ /* Disconnect transport */
+ if (session->id > 0 && session->transport != NULL) {
+ session->transport->disconnect(session->id);
+ session->id = 0;
+ }
+
session_free(session);
}
if (session->path)
session_unregistered(session);
- /* Disconnect transport */
- if (session->id > 0 && session->transport != NULL) {
- session->transport->disconnect(session->id);
- session->id = 0;
- }
-
obc_session_unref(session);
}