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

SmartPtr: Support detect memory leak by valgrind. v6.0.132 (#4102)

1. Support detect memory leak by valgrind.
2. Free the http handler entry.
3. Free the stack of ST.

---

Co-authored-by: Jacob Su <suzp1984@gmail.com>
This commit is contained in:
Winlin 2024-06-29 11:16:32 +08:00 committed by GitHub
parent ea7e2c2849
commit 7ab012c60f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 286 additions and 69 deletions

View file

@ -94,7 +94,7 @@ SrsIngester::SrsIngester()
disposed = false;
trd = new SrsDummyCoroutine();
pprint = SrsPithyPrint::create_ingester();
pprint_ = SrsPithyPrint::create_ingester();
}
SrsIngester::~SrsIngester()
@ -103,6 +103,7 @@ SrsIngester::~SrsIngester()
srs_freep(trd);
clear_engines();
srs_freep(pprint_);
}
void SrsIngester::dispose()
@ -466,7 +467,7 @@ srs_error_t SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective*
void SrsIngester::show_ingest_log_message()
{
pprint->elapse();
pprint_->elapse();
if ((int)ingesters.size() <= 0) {
return;
@ -477,9 +478,9 @@ void SrsIngester::show_ingest_log_message()
SrsIngesterFFMPEG* ingester = ingesters.at(index);
// reportable
if (pprint->can_print()) {
if (pprint_->can_print()) {
srs_trace("-> " SRS_CONSTS_LOG_INGESTER " time=%dms, ingesters=%d, #%d(alive=%dms, %s)",
srsu2msi(pprint->age()), (int)ingesters.size(), index, srsu2msi(ingester->alive()), ingester->uri().c_str());
srsu2msi(pprint_->age()), (int)ingesters.size(), index, srsu2msi(ingester->alive()), ingester->uri().c_str());
}
}