summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2009-06-16 20:40:57 -0400
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2009-06-16 20:40:57 -0400
commit8db7bdfae57bb77029fd645aec26529dcc48bccb (patch)
tree48ca3d4b2e15bf6f4407e40f9b9f2691489147e0
parent2faa76a4840100bebd9532bd47a2755874c5b3a0 (diff)
downloadlibnice-8db7bdfae57bb77029fd645aec26529dcc48bccb.tar.gz
unlock the mutex before calling the recv callback
-rw-r--r--agent/agent.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/agent/agent.c b/agent/agent.c
index c46f18f..7d046e8 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -2073,8 +2073,14 @@ nice_agent_g_source_cb (
MAX_BUFFER_SIZE, buf);
if (len > 0 && component->g_source_io_cb) {
- component->g_source_io_cb (agent, stream->id, component->id,
- len, buf, component->data);
+ gpointer data = component->data;
+ gint sid = stream->id;
+ gint cid = component->id;
+ NiceAgentRecvFunc callback = component->g_source_io_cb;
+ /* Unlock the agent before calling the callback */
+ agent_unlock();
+ callback (agent, sid, cid, len, buf, data);
+ goto done;
} else if (len < 0) {
GSource *source = ctx->source;
component->gsources = g_slist_remove (component->gsources, source);