avoid calling notify handler if terminated

This commit is contained in:
Richard Aas 2011-12-16 13:37:52 +00:00
parent f9a2aa88a4
commit a6eaa8c121

View file

@ -217,6 +217,9 @@ static void notify_handler(struct sipevent_sock *sock,
break;
}
if (sub->terminated)
return;
mem_ref(sub);
sub->notifyh(msg, sub->arg);
nrefs = mem_nrefs(sub);
@ -226,7 +229,7 @@ static void notify_handler(struct sipevent_sock *sock,
if (nrefs == 1)
return;
if (!sub->terminated && state.state == SIPEVENT_TERMINATED)
if (state.state == SIPEVENT_TERMINATED)
sipsub_terminate(sub, 0, msg);
}