From 2735b4a8debc15709a073f03c8b36ba95ef6977b Mon Sep 17 00:00:00 2001 From: irungentoo Date: Thu, 26 Jun 2014 17:05:13 -0400 Subject: [PATCH] Fixed segfault that happened because calls could be hanged up more than once. --- toxav/msi.c | 1 + toxav/msi.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/toxav/msi.c b/toxav/msi.c index 6c4f2637..060e52a4 100644 --- a/toxav/msi.c +++ b/toxav/msi.c @@ -1641,6 +1641,7 @@ int msi_hangup ( MSISession *session, int32_t call_index ) for ( ; _it < session->calls[call_index]->peer_count; _it ++ ) send_message ( session, session->calls[call_index], _msg_end, session->calls[call_index]->peers[_it] ); + session->calls[call_index]->state = call_hanged_up; free_message ( _msg_end ); diff --git a/toxav/msi.h b/toxav/msi.h index fdf0a88c..156c1895 100644 --- a/toxav/msi.h +++ b/toxav/msi.h @@ -50,7 +50,8 @@ typedef enum { call_inviting, /* when sending call invite */ call_starting, /* when getting call invite */ call_active, - call_hold + call_hold, + call_hanged_up } MSICallState;