1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix memory leak at source. 2.0.214

This commit is contained in:
winlin 2016-09-05 14:13:37 +08:00
parent 6ec60b0a21
commit c7b97aa1c3
8 changed files with 103 additions and 4 deletions

View file

@ -71,6 +71,15 @@ int SrsThreadContext::set_id(int v)
return ov;
}
void SrsThreadContext::clear_cid()
{
st_thread_t self = st_thread_self();
std::map<st_thread_t, int>::iterator it = cache.find(self);
if (it != cache.end()) {
cache.erase(it);
}
}
// the max size of a line of log.
#define LOG_MAX_SIZE 4096