summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@collabora.com>2019-01-28 14:17:18 +0100
committerJakub Adam <jakub.adam@collabora.com>2019-01-29 12:13:05 +0100
commit047455fe8d1164bbae9ef233073d757a6b999952 (patch)
tree74a760108cc04de603c3c8d9c84f65fdd97c30de
parent74a3201819bfcaaad30d76a03cf2a4fe0b8aa660 (diff)
downloadlibnice-047455fe8d1164bbae9ef233073d757a6b999952.tar.gz
component_io_cb: Avoid potential deadlock
Don't unref NiceAgent while holding agent mutex. If it's the last reference, nice_agent_dispose() will try to acquire the mutex again and deadlock.
-rw-r--r--agent/agent.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 3c1cdcd..e918c03 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -5387,9 +5387,10 @@ done:
return !remove_source;
out:
+ agent_unlock_and_emit (agent);
+
g_object_unref (agent);
- agent_unlock_and_emit (agent);
return G_SOURCE_REMOVE;
}