Core/Misc: Fixed compiler segmentation fault when compiling AsyncAcceptor with gcc 4.7.2

This commit is contained in:
Shauren
2014-07-11 22:07:48 +02:00
parent 128217c4c4
commit eaee0f5dd0

View File

@@ -26,8 +26,8 @@ template <class T>
class AsyncAcceptor
{
public:
AsyncAcceptor(boost::asio::io_service& ioService, std::string bindIp, int port) :
_socket(ioService),
AsyncAcceptor(boost::asio::io_service& ioService, std::string bindIp, int port) :
_socket(ioService),
_acceptor(ioService, tcp::endpoint(boost::asio::ip::address::from_string(bindIp), port))
{
AsyncAccept();
@@ -49,7 +49,8 @@ private:
{
if (!error)
{
std::make_shared<T>(std::move(_socket))->Start();
// this-> is required here to fix an segmentation fault in gcc 4.7.2 - reason is lambdas in a templated class
std::make_shared<T>(std::move(this->_socket))->Start();
}
AsyncAccept();