mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 12:57:31 +02:00
Fix memory leak in advanced server examples
This commit is contained in:
committed by
Vinnie Falco
parent
cbcc034a70
commit
9f3c981d6a
@ -1,3 +1,9 @@
|
|||||||
|
Version 155:
|
||||||
|
|
||||||
|
* Fix memory leak in advanced server examples
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 154:
|
Version 154:
|
||||||
|
|
||||||
* Type check completion handlers
|
* Type check completion handlers
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <boost/asio/ssl/stream.hpp>
|
#include <boost/asio/ssl/stream.hpp>
|
||||||
#include <boost/asio/strand.hpp>
|
#include <boost/asio/strand.hpp>
|
||||||
#include <boost/asio/steady_timer.hpp>
|
#include <boost/asio/steady_timer.hpp>
|
||||||
|
#include <boost/make_unique.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -745,7 +746,8 @@ class http_session
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Allocate and store the work
|
// Allocate and store the work
|
||||||
items_.emplace_back(new work_impl(self_, std::move(msg)));
|
items_.push_back(
|
||||||
|
boost::make_unique<work_impl>(self_, std::move(msg)));
|
||||||
|
|
||||||
// If there was no previous work, start this one
|
// If there was no previous work, start this one
|
||||||
if(items_.size() == 1)
|
if(items_.size() == 1)
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <boost/asio/ip/tcp.hpp>
|
#include <boost/asio/ip/tcp.hpp>
|
||||||
#include <boost/asio/strand.hpp>
|
#include <boost/asio/strand.hpp>
|
||||||
#include <boost/asio/steady_timer.hpp>
|
#include <boost/asio/steady_timer.hpp>
|
||||||
|
#include <boost/make_unique.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -539,7 +540,8 @@ class http_session : public std::enable_shared_from_this<http_session>
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Allocate and store the work
|
// Allocate and store the work
|
||||||
items_.emplace_back(new work_impl(self_, std::move(msg)));
|
items_.push_back(
|
||||||
|
boost::make_unique<work_impl>(self_, std::move(msg)));
|
||||||
|
|
||||||
// If there was no previous work, start this one
|
// If there was no previous work, start this one
|
||||||
if(items_.size() == 1)
|
if(items_.size() == 1)
|
||||||
|
Reference in New Issue
Block a user