From 20c8e6423b8cc3d6798a0bcffc6303b0bcb1da73 Mon Sep 17 00:00:00 2001 From: Winlin Date: Thu, 4 Jul 2024 16:08:42 +0800 Subject: [PATCH] SmartPtr: Fix SRT source memory leaking. v6.0.134 (#4106) --------- Co-authored-by: john --- trunk/3rdparty/srs-bench/README.md | 2 ++ trunk/doc/CHANGELOG.md | 1 + trunk/src/app/srs_app_srt_source.cpp | 3 +++ trunk/src/core/srs_core_version6.hpp | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/trunk/3rdparty/srs-bench/README.md b/trunk/3rdparty/srs-bench/README.md index 8bda975415..21b8939b1a 100644 --- a/trunk/3rdparty/srs-bench/README.md +++ b/trunk/3rdparty/srs-bench/README.md @@ -33,6 +33,8 @@ cd srs/trunk && ./configure --h265=on --gb28181=on && make && ./objs/srs -c conf/console.conf ``` +> Note: Use valgrind to check memory leak, please use `valgrind --leak-check=full ./objs/srs -c conf/console.conf >/dev/null` to start SRS. + 具体场景,请按下面的操作启动测试。 ## Player for WHEP diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 6f24371357..7d49a8cf3a 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog for SRS. ## SRS 6.0 Changelog +* v6.0, 2024-07-04, Merge [#4106](https://github.com/ossrs/srs/pull/4106): SmartPtr: Fix SRT source memory leaking. v6.0.134 (#4106) * v6.0, 2024-06-29, Merge [#4077](https://github.com/ossrs/srs/pull/4077): Fix misspelling error in app config. v6.0.133 (#4077) * v6.0, 2024-06-29, Merge [#4102](https://github.com/ossrs/srs/pull/4102): SmartPtr: Support detect memory leak by valgrind. v6.0.132 (#4102) * v6.0, 2024-06-21, Merge [#4100](https://github.com/ossrs/srs/pull/4100): Fix security scan problems. v6.0.131 (#4100) diff --git a/trunk/src/app/srs_app_srt_source.cpp b/trunk/src/app/srs_app_srt_source.cpp index 990cb2c133..b3383e6fa3 100644 --- a/trunk/src/app/srs_app_srt_source.cpp +++ b/trunk/src/app/srs_app_srt_source.cpp @@ -1083,6 +1083,9 @@ void SrsSrtSource::on_unpublish() can_publish_ = true; + SrsStatistic* stat = SrsStatistic::instance(); + stat->on_stream_close(req); + if (bridge_) { frame_builder_->on_unpublish(); srs_freep(frame_builder_); diff --git a/trunk/src/core/srs_core_version6.hpp b/trunk/src/core/srs_core_version6.hpp index 775c9d3592..db87015415 100644 --- a/trunk/src/core/srs_core_version6.hpp +++ b/trunk/src/core/srs_core_version6.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 6 #define VERSION_MINOR 0 -#define VERSION_REVISION 133 +#define VERSION_REVISION 134 #endif