diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-05-03 19:56:21 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-05-03 19:56:21 +0000 |
commit | 0a2d5c3cd9d32c77fcf23976736324ebb0565d44 (patch) | |
tree | bebc99d373b81095046eda50cc6383040beb8835 /pjlib/src/pj/sock_symbian.cpp | |
parent | abb1aee315f44c03cc3da3627a93651cdd9ca15e (diff) |
Misc Symbian fixes, looks good
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1248 74dad513-b988-da41-8d7b-12977e46ad98
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; |