[Boost-bugs] [Boost C++ Libraries] #3107: Error in allocation/dealocation of timers

Subject: [Boost-bugs] [Boost C++ Libraries] #3107: Error in allocation/dealocation of timers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-29 10:22:53


#3107: Error in allocation/dealocation of timers
--------------------------+-------------------------------------------------
 Reporter: anonymous | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: asio
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: |
--------------------------+-------------------------------------------------
 Function enqueue_timer from timer_queue.hpp allocate new timers with the
 following code:

     std::auto_ptr<timer<Handler> > new_timer(
         new timer<Handler>(time, handler, token));

 and later this timer will be deallocated with asio_handler_deallocate.
 Solution:
 replace "new-based" allocation with asio_handler_allocate:

     typedef timer<Handler> timer_type;
     typedef handler_alloc_traits<Handler, timer_type> alloc_traits;
     raw_handler_ptr<alloc_traits> raw_ptr(handler);
     handler_ptr<alloc_traits> new_timer(raw_ptr, time, handler, token);

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3107>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC