summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-04-29 14:23:04 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-04-29 14:23:04 +0000
commitf0056a32226d99db3d95f0e995c815640519749c (patch)
tree70691dc7dc3f05f3bb5a5a80a7b600ad5aa06ab4 /common
parent05302369d81c96d475b50d1feb002cd9a25804cf (diff)
Close sdp session before calling the application callback.
Diffstat (limited to 'common')
-rw-r--r--common/glib-helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/glib-helper.c b/common/glib-helper.c
index f76cdecb..7810ba7e 100644
--- a/common/glib-helper.c
+++ b/common/glib-helper.c
@@ -63,7 +63,6 @@ static void search_context_cleanup(struct search_context *ctxt)
{
if (ctxt->destroy)
ctxt->destroy(ctxt->user_data);
- sdp_close(ctxt->session);
g_free(ctxt);
}
@@ -107,9 +106,9 @@ static void search_completed_cb(uint8_t type, uint16_t status,
} while (scanned < size);
done:
+ sdp_close(ctxt->session);
if (ctxt->cb)
ctxt->cb(recs, err, ctxt->user_data);
-
search_context_cleanup(ctxt);
}
@@ -131,6 +130,7 @@ static gboolean search_process_cb(GIOChannel *chan,
failed:
if (err) {
+ sdp_close(ctxt->session);
if (ctxt->cb)
ctxt->cb(NULL, err, ctxt->user_data);
search_context_cleanup(ctxt);
@@ -182,6 +182,7 @@ static gboolean connect_watch(GIOChannel *chan, GIOCondition cond, gpointer user
return FALSE;
failed:
+ sdp_close(ctxt->session);
if (ctxt->cb)
ctxt->cb(NULL, -err, ctxt->user_data);
search_context_cleanup(ctxt);