summaryrefslogtreecommitdiff
path: root/pjlib/src
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2015-06-25 08:53:02 +0000
committerLiong Sauw Ming <ming@teluu.com>2015-06-25 08:53:02 +0000
commit543e2e75813d09b213bcdbbd73e5e445ce233983 (patch)
treea846d9fe787267135d17395656bbe1a8d6010e2f /pjlib/src
parent97f362db7fa1fad9a0258bdb5e218b80dab93031 (diff)
Fixed #1862: Crash on iOS when destroying an activesock and creating a new one at the same time
Thanks to Itay Bianco for the report. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5119 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src')
-rw-r--r--pjlib/src/pj/activesock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pjlib/src/pj/activesock.c b/pjlib/src/pj/activesock.c
index d93bd630..e061b9cb 100644
--- a/pjlib/src/pj/activesock.c
+++ b/pjlib/src/pj/activesock.c
@@ -299,12 +299,13 @@ PJ_DEF(pj_status_t) pj_activesock_close(pj_activesock_t *asock)
PJ_ASSERT_RETURN(asock, PJ_EINVAL);
asock->shutdown = SHUT_RX | SHUT_TX;
if (asock->key) {
+ pj_ioqueue_unregister(asock->key);
+
#if defined(PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT) && \
PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT!=0
activesock_destroy_iphone_os_stream(asock);
#endif
-
- pj_ioqueue_unregister(asock->key);
+
asock->key = NULL;
}
return PJ_SUCCESS;