summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-09-26 12:56:52 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2014-09-26 12:56:52 +0100
commita26ab492b00a34d7dc9349fb294faf39bf5b4672 (patch)
tree0ecd23bdbf4f60ef70c3f8500c29bfa52c3bdfac
parent77c1e1ed9dfc6628d37ae4f28da6327890f65139 (diff)
downloadlibnice-a26ab492b00a34d7dc9349fb294faf39bf5b4672.tar.gz
agent: Delay some assignments until the agent is locked
This makes helgrind slightly happier.
-rw-r--r--agent/agent.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 2fd74b8..86421d8 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1769,11 +1769,14 @@ static gboolean
notify_pseudo_tcp_socket_clock (gpointer user_data)
{
Component *component = user_data;
- Stream *stream = component->stream;
- NiceAgent *agent = component->agent;
+ Stream *stream;
+ NiceAgent *agent;
agent_lock();
+ stream = component->stream;
+ agent = component->agent;
+
if (g_source_is_destroyed (g_main_current_source ())) {
nice_debug ("Source was destroyed. "
"Avoided race condition in notify_pseudo_tcp_socket_clock");