You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.
as my issue says:there is a assert happend if call the cppredis::publish function in multithread at debug mode?
the code is in tcp_client.cpp line 191
191: if (length >= m_write_buffer.front().size())
m_write_buffer.pop_front();
else
m_write_buffer.front().erase(m_write_buffer.front().begin(), m_write_buffer.front().begin() + length);
the std::list::front() function is directly use *begin(),so if m_write_buffer is empty ,the begin() iterator is equal end() ,is a invalid iterator,and VC++ will report a assertion .
my suggestion is add some code before line 191 like this
if(m_write_buffer.empty())
return;
sorry for my poor english...
The text was updated successfully, but these errors were encountered:
I have done the modification on a branch but still get an assert about 1 time every 10 runs of my automated tests, so the if statement is not enough.
I'm going to give a look into that. I'm not the author of the Windows port, so it might slow me down a bit to debug that, but I'll try to fix that as quick as possible.
as my issue says:there is a assert happend if call the cppredis::publish function in multithread at debug mode?
the code is in tcp_client.cpp line 191
191: if (length >= m_write_buffer.front().size())
m_write_buffer.pop_front();
else
m_write_buffer.front().erase(m_write_buffer.front().begin(), m_write_buffer.front().begin() + length);
the std::list::front() function is directly use *begin(),so if m_write_buffer is empty ,the begin() iterator is equal end() ,is a invalid iterator,and VC++ will report a assertion .
my suggestion is add some code before line 191 like this
if(m_write_buffer.empty())
return;
sorry for my poor english...
The text was updated successfully, but these errors were encountered: