From f0056a32226d99db3d95f0e995c815640519749c Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 29 Apr 2008 14:23:04 +0000 Subject: Close sdp session before calling the application callback. --- common/glib-helper.c | 5 +++-- 1 file 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); -- cgit