表达式:_BLOCK_TYPE_ISVAILD(pHead->nBlockUse)
void Connection::Receive(){
socket_.async_read_some(boost::asio::buffer(read_buffer_),
boost::bind(&Connection::handle_Receive, shared_from_this(),boost::asio::placeholders::error));
}
void Connection::handle_Receive(const boost::system::error_code& error)
{
if(!error)
{
if(read_buffer_.size() <=0){
read_buffer_.empty();
this->Disconnect();
}
ByteBuffer b((std::shared_ptr<uint8_t>)read_buffer_.data(), read_buffer_.size());
this->OnReceived(b);
read_buffer_.empty();
}
//when it loses the if(!error) scope the error pop-up
}
错误:
Debug Assertion Faild!
Program: D:\C++\Server\Debug\Authsever.exe
File:f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Expression: _BLOCK_TYPE_ISVAILD(pHead->nBlockUse)
当它失去 if(!error) 范围时,会弹出错误,这个错误是什么意思?!
void Connection::Receive(){
socket_.async_read_some(boost::asio::buffer(read_buffer_),
boost::bind(&Connection::handle_Receive, shared_from_this(),boost::asio::placeholders::error));
}
void Connection::handle_Receive(const boost::system::error_code& error)
{
if(!error)
{
if(read_buffer_.size() <=0){
read_buffer_.empty();
this->Disconnect();
}
ByteBuffer b((std::shared_ptr<uint8_t>)read_buffer_.data(), read_buffer_.size());
this->OnReceived(b);
read_buffer_.empty();
}
//when it loses the if(!error) scope the error pop-up
}
Error:
Debug Assertion Faild!
Program: D:\C++\Server\Debug\Authsever.exe
File:f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Expression: _BLOCK_TYPE_ISVAILD(pHead->nBlockUse)
when it loses the if(!error) scope the error pop-up, what is this error means?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将
boost::array
拥有的uint8_t*
转换为std::shared_ptr
,您会得到双重删除代码>.不要这样做,
shared_ptr
用于具有动态存储持续时间的指针。You are getting a double delete from casting a
uint8_t*
that is owned by aboost::array<uint8_t,1000>
to astd::shared_ptr
.Don't do that, a
shared_ptr
is for pointers with dynamic storage duration.