Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2008-03-28 01:09:56


Author: chris_kohlhoff
Date: 2008-03-28 01:09:55 EDT (Fri, 28 Mar 2008)
New Revision: 43903
URL: http://svn.boost.org/trac/boost/changeset/43903

Log:
Merged revisions 43879 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r43879 | chris_kohlhoff | 2008-03-28 01:18:07 +1100 (Fri, 28 Mar 2008) | 3 lines
  
  Fix double-free error that occurs when an exception is thrown from a
  handler that has been dispatched (i.e. not posted) through a strand.
........

Properties modified:
   branches/release/ (props changed)
Text files modified:
   branches/release/boost/asio/detail/strand_service.hpp | 6 ++----
   1 files changed, 2 insertions(+), 4 deletions(-)

Modified: branches/release/boost/asio/detail/strand_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/strand_service.hpp (original)
+++ branches/release/boost/asio/detail/strand_service.hpp 2008-03-28 01:09:55 EDT (Fri, 28 Mar 2008)
@@ -428,10 +428,9 @@
       if (impl->current_handler_ == 0)
       {
         // This handler now has the lock, so can be dispatched immediately.
- impl->current_handler_ = ptr.get();
+ impl->current_handler_ = ptr.release();
         lock.unlock();
         this->get_io_service().dispatch(invoke_current_handler(*this, impl));
- ptr.release();
       }
       else
       {
@@ -468,10 +467,9 @@
     if (impl->current_handler_ == 0)
     {
       // This handler now has the lock, so can be dispatched immediately.
- impl->current_handler_ = ptr.get();
+ impl->current_handler_ = ptr.release();
       lock.unlock();
       this->get_io_service().post(invoke_current_handler(*this, impl));
- ptr.release();
     }
     else
     {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk