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

@ -1073,9 +1073,6 @@ void SrsHttpStreamServer::http_unmount(SrsRequest* r)
SrsBufferCache* cache = entry->cache;
SrsAutoFree(SrsBufferCache, cache);
// Unmount the HTTP handler.
mux.unhandle(entry->mount, stream);
// Notify cache and stream to stop.
if (stream->entry) stream->entry->enabled = false;
cache->stop();
@ -1089,6 +1086,10 @@ void SrsHttpStreamServer::http_unmount(SrsRequest* r)
srs_usleep(100 * SRS_UTIME_MILLISECONDS);
}
// Unmount the HTTP handler, which will free the entry. Note that we must free it after cache and
// stream stopped for it uses it.
mux.unhandle(entry->mount, stream);
srs_trace("http: unmount flv stream for sid=%s, i=%d", sid.c_str(), i);
}