summaryrefslogtreecommitdiff
path: root/toxav/phone.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-03-14 21:12:05 -0400
committerirungentoo <irungentoo@gmail.com>2014-03-14 21:12:05 -0400
commit99d8300e1b1a057520ac7498895ebeb1a5290452 (patch)
tree406a3dea8cdd670f864196fb89a67986f693cbcc /toxav/phone.c
parente143e5d7f624addb284bbd683d50848b490fb7ac (diff)
parent6a63605501a28be966d821ee3ec10d8da751142d (diff)
Merge branch 'master' of https://github.com/mannol1/ProjectTox-Core into mouseym-patch-3
Diffstat (limited to 'toxav/phone.c')
-rwxr-xr-xtoxav/phone.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/toxav/phone.c b/toxav/phone.c
index 43d24a2f..fb159f57 100755
--- a/toxav/phone.c
+++ b/toxav/phone.c
@@ -1147,18 +1147,21 @@ failed_init_ffmpeg: ;
1147 1147
1148int av_terminate_session(av_session_t *_phone) 1148int av_terminate_session(av_session_t *_phone)
1149{ 1149{
1150 toxav_hangup(_phone->av); 1150 _phone->running_decaud = 0;
1151 1151 usleep(100000); /* Wait for tox_poll to end */
1152 free(_phone->_friends); 1152
1153 pthread_mutex_destroy ( &_phone->_mutex ); 1153 toxav_kill(_phone->av);
1154 1154 printf("\r[i] KILLED AV ARGH!\n");
1155
1156 usleep(1000000); /* Wait for cancel request to be sent */
1155 Tox *_p = _phone->_messenger; 1157 Tox *_p = _phone->_messenger;
1156 _phone->_messenger = NULL; 1158 _phone->_messenger = NULL;
1157 usleep(100000); /* Wait for tox_poll to end */
1158
1159 tox_kill(_p); 1159 tox_kill(_p);
1160 toxav_kill(_phone->av);
1161 1160
1161
1162 free(_phone->_friends);
1163 pthread_mutex_destroy ( &_phone->_mutex );
1164
1162 free(_phone); 1165 free(_phone);
1163 1166
1164 printf("\r[i] Quit!\n"); 1167 printf("\r[i] Quit!\n");