Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP
00012 #define ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP
00013
00014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
00015 # pragma once
00016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
00017
00018 #include "asio/detail/push_options.hpp"
00019
00020 #include "asio/detail/push_options.hpp"
00021 #include <boost/config.hpp>
00022 #include "asio/detail/pop_options.hpp"
00023
00024 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
00025
00026 #include "asio/detail/noncopyable.hpp"
00027 #include "asio/detail/socket_types.hpp"
00028
00029 namespace asio {
00030 namespace detail {
00031
00032 class local_free_on_block_exit
00033 : private noncopyable
00034 {
00035 public:
00036
00037 explicit local_free_on_block_exit(void* p)
00038 : p_(p)
00039 {
00040 }
00041
00042
00043 ~local_free_on_block_exit()
00044 {
00045 ::LocalFree(p_);
00046 }
00047
00048 private:
00049 void* p_;
00050 };
00051
00052 }
00053 }
00054
00055 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
00056
00057 #include "asio/detail/pop_options.hpp"
00058
00059 #endif // ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP