diff options
Diffstat (limited to 'pjlib/src/pj/sock_symbian.cpp')
-rw-r--r-- | pjlib/src/pj/sock_symbian.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/pjlib/src/pj/sock_symbian.cpp b/pjlib/src/pj/sock_symbian.cpp index 8d2ab077..ae691bae 100644 --- a/pjlib/src/pj/sock_symbian.cpp +++ b/pjlib/src/pj/sock_symbian.cpp @@ -66,12 +66,7 @@ const pj_uint16_t PJ_SO_SNDBUF = 0xFFFF; CPjSocket::~CPjSocket() { - if (sockReader_) { - if (sockReader_->IsActive()) - sockReader_->Cancel(); - delete sockReader_; - sockReader_ = NULL; - } + DestroyReader(); sock_.Close(); } @@ -83,6 +78,17 @@ CPjSocketReader *CPjSocket::CreateReader(unsigned max_len) return sockReader_ = CPjSocketReader::NewL(*this, max_len); } +// Delete socket reader when it's not wanted. +void CPjSocket::DestroyReader() +{ + if (sockReader_) { + if (sockReader_->IsActive()) + sockReader_->Cancel(); + delete sockReader_; + sockReader_ = NULL; + } +} + ///////////////////////////////////////////////////////////////////////////// // @@ -163,7 +169,6 @@ void CPjSocketReader::RunL() { void (*old_cb)(void *key) = readCb_; void *old_key = key_; - bool is_active = IsActive(); readCb_ = NULL; key_ = NULL; |