From 811ef4bcf6c9e0f23cc0937b9f30d0cfd4e747f2 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 7 Jun 2015 09:27:47 +0800 Subject: [PATCH] dispose the gop cache --- trunk/src/app/srs_app_server.cpp | 2 ++ trunk/src/app/srs_app_source.cpp | 7 +++++++ trunk/src/app/srs_app_source.hpp | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 1fcfff052..88c8c4b75 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -523,6 +523,8 @@ void SrsServer::destroy() ingester->dispose(); #endif + SrsSource::dispose_all(); + #ifdef SRS_AUTO_HTTP_API srs_freep(http_api_mux); #endif diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index 72d0f08c2..2a5417a9d 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -583,6 +583,11 @@ SrsGopCache::~SrsGopCache() clear(); } +void SrsGopCache::dispose() +{ + clear(); +} + void SrsGopCache::set(bool enabled) { enable_gop_cache = enabled; @@ -955,6 +960,8 @@ void SrsSource::dispose() #ifdef SRS_AUTO_HLS hls->dispose(); #endif + + gop_cache->dispose(); } int SrsSource::cycle() diff --git a/trunk/src/app/srs_app_source.hpp b/trunk/src/app/srs_app_source.hpp index bdb4d5f4c..95eda44ea 100644 --- a/trunk/src/app/srs_app_source.hpp +++ b/trunk/src/app/srs_app_source.hpp @@ -309,6 +309,10 @@ public: SrsGopCache(); virtual ~SrsGopCache(); public: + /** + * cleanup when system quit. + */ + virtual void dispose(); /** * to enable or disable the gop cache. */