diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-09-02 11:13:40 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-09-02 13:29:43 +0300 |
commit | 361f5d4b6bc40e41c6ca4aca11dcd91bafbb4f3a (patch) | |
tree | efe677696fcd0234243c07a630b2e525da4fc73f /obexd | |
parent | 904d3418a2dbb719aac8d6616ecfad7b0c84b711 (diff) |
obexd: Fix disconnecting underline transport before processing operations
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.
Diffstat (limited to 'obexd')
-rw-r--r-- | obexd/client/session.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/obexd/client/session.c b/obexd/client/session.c index 632e114b5..331d23d15 100644 --- a/obexd/client/session.c +++ b/obexd/client/session.c @@ -258,6 +258,12 @@ void obc_session_unref(struct obc_session *session) if (refs > 0) return; + /* Disconnect transport */ + if (session->id > 0 && session->transport != NULL) { + session->transport->disconnect(session->id); + session->id = 0; + } + session_free(session); } @@ -555,12 +561,6 @@ void obc_session_shutdown(struct obc_session *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); } |