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

Asan: Try to fix st_memory_leak for asan check (#3264)

* asan: try to fix st_memory_leak for asan check

* asan: srs_st_unit should be call in hybrid server stop

* Rename st_uninit to st_destroy. v5.0.91

Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
ChenGH 2022-11-21 23:49:38 +08:00 committed by GitHub
parent 6fa17aa3f8
commit 6b130d4205
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 2 deletions

View file

@ -235,6 +235,8 @@ void SrsHybridServer::stop()
ISrsHybridServer* server = *it;
server->stop();
}
srs_st_destroy();
}
SrsServerAdapter* SrsHybridServer::srs()

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 90
#define VERSION_REVISION 91
#endif

View file

@ -76,6 +76,11 @@ srs_error_t srs_st_init()
return srs_success;
}
void srs_st_destroy(void)
{
st_destroy();
}
void srs_close_stfd(srs_netfd_t& stfd)
{
if (stfd) {

View file

@ -20,8 +20,10 @@ typedef void* srs_thread_t;
typedef void* srs_cond_t;
typedef void* srs_mutex_t;
// Initialize st, requires epoll.
// Initialize ST, requires epoll for linux.
extern srs_error_t srs_st_init();
// Destroy ST, free resources for asan detecting.
extern void srs_st_destroy(void);
// Close the netfd, and close the underlayer fd.
// @remark when close, user must ensure io completed.