From 0a2d5c3cd9d32c77fcf23976736324ebb0565d44 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 3 May 2007 19:56:21 +0000 Subject: Misc Symbian fixes, looks good git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1248 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/sock_symbian.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'pjlib/src/pj/sock_symbian.cpp') 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; -- cgit v1.2.3