component_io_cb: Avoid potential deadlock
authorJakub Adam <jakub.adam@collabora.com>
Mon, 28 Jan 2019 13:17:18 +0000 (14:17 +0100)
committerJakub Adam <jakub.adam@collabora.com>
Tue, 29 Jan 2019 11:13:05 +0000 (12:13 +0100)
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.

agent/agent.c

index 3c1cdcd..e918c03 100644 (file)
@@ -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;
 }