Skip to content

Commit 93d7e97

Browse files
author
Valtteri Heikkila
committed
Fixed OS X issue where linux_client_request_context was not deleted due shared_ptr reference.
1 parent 6fe6679 commit 93d7e97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Release/src/http/client/http_linux.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ namespace web { namespace http
137137
std::mutex m_connections_mutex;
138138
};
139139

140-
class linux_client_request_context : public request_context, public std::enable_shared_from_this<linux_client_request_context>
140+
class linux_client_request_context : public request_context
141141
{
142142
public:
143143
static std::shared_ptr<request_context> create_request_context(std::shared_ptr<_http_client_communicator> &client, http_request &request);
@@ -185,14 +185,14 @@ namespace web { namespace http
185185
void set_timer(const int secs)
186186
{
187187
m_timeout_timer.expires_from_now(boost::posix_time::milliseconds(secs * 1000));
188-
m_timeout_timer.async_wait(boost::bind(&linux_client_request_context::handle_timeout_timer, shared_from_this(), boost::asio::placeholders::error));
188+
m_timeout_timer.async_wait(boost::bind(&linux_client_request_context::handle_timeout_timer, this, boost::asio::placeholders::error));
189189
}
190190

191191
void reset_timer(const int secs)
192192
{
193193
if (m_timeout_timer.expires_from_now(boost::posix_time::milliseconds(secs * 1000)) > 0)
194194
{
195-
m_timeout_timer.async_wait(boost::bind(&linux_client_request_context::handle_timeout_timer, shared_from_this(), boost::asio::placeholders::error));
195+
m_timeout_timer.async_wait(boost::bind(&linux_client_request_context::handle_timeout_timer, this, boost::asio::placeholders::error));
196196
}
197197
}
198198

0 commit comments

Comments
 (0)