diff options
-rw-r--r-- | pjlib/src/pj/activesock.c | 5 |
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; |