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

@ -8,6 +8,7 @@ The changelog for SRS.
## SRS 5.0 Changelog ## SRS 5.0 Changelog
* v5.0, 2022-11-21, Merge [#3264](https://github.com/ossrs/srs/pull/3264): Asan: Try to fix st_memory_leak for asan check. (#3264). v5.0.91
* v5.0, 2022-11-21, Asan: Fix global ip address leak check. v5.0.90 * v5.0, 2022-11-21, Asan: Fix global ip address leak check. v5.0.90
* v5.0, 2022-11-20, For [#2532](https://github.com/ossrs/srs/issues/2532): Windows: Support cygwin pipline and packager. v5.0.89 * v5.0, 2022-11-20, For [#2532](https://github.com/ossrs/srs/issues/2532): Windows: Support cygwin pipline and packager. v5.0.89
* v5.0, 2022-11-18, Fix [#3215](https://github.com/ossrs/srs/issues/3215): Callback: Fix bug for response string 0. v5.0.88 * v5.0, 2022-11-18, Fix [#3215](https://github.com/ossrs/srs/issues/3215): Callback: Fix bug for response string 0. v5.0.88

View file

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

View file

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

View file

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

View file

@ -20,8 +20,10 @@ typedef void* srs_thread_t;
typedef void* srs_cond_t; typedef void* srs_cond_t;
typedef void* srs_mutex_t; typedef void* srs_mutex_t;
// Initialize st, requires epoll. // Initialize ST, requires epoll for linux.
extern srs_error_t srs_st_init(); 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. // Close the netfd, and close the underlayer fd.
// @remark when close, user must ensure io completed. // @remark when close, user must ensure io completed.