正在显示
3 个修改的文件
包含
13 行增加
和
0 行删除
| @@ -523,6 +523,8 @@ void SrsServer::destroy() | @@ -523,6 +523,8 @@ void SrsServer::destroy() | ||
| 523 | ingester->dispose(); | 523 | ingester->dispose(); |
| 524 | #endif | 524 | #endif |
| 525 | 525 | ||
| 526 | + SrsSource::dispose_all(); | ||
| 527 | + | ||
| 526 | #ifdef SRS_AUTO_HTTP_API | 528 | #ifdef SRS_AUTO_HTTP_API |
| 527 | srs_freep(http_api_mux); | 529 | srs_freep(http_api_mux); |
| 528 | #endif | 530 | #endif |
| @@ -583,6 +583,11 @@ SrsGopCache::~SrsGopCache() | @@ -583,6 +583,11 @@ SrsGopCache::~SrsGopCache() | ||
| 583 | clear(); | 583 | clear(); |
| 584 | } | 584 | } |
| 585 | 585 | ||
| 586 | +void SrsGopCache::dispose() | ||
| 587 | +{ | ||
| 588 | + clear(); | ||
| 589 | +} | ||
| 590 | + | ||
| 586 | void SrsGopCache::set(bool enabled) | 591 | void SrsGopCache::set(bool enabled) |
| 587 | { | 592 | { |
| 588 | enable_gop_cache = enabled; | 593 | enable_gop_cache = enabled; |
| @@ -955,6 +960,8 @@ void SrsSource::dispose() | @@ -955,6 +960,8 @@ void SrsSource::dispose() | ||
| 955 | #ifdef SRS_AUTO_HLS | 960 | #ifdef SRS_AUTO_HLS |
| 956 | hls->dispose(); | 961 | hls->dispose(); |
| 957 | #endif | 962 | #endif |
| 963 | + | ||
| 964 | + gop_cache->dispose(); | ||
| 958 | } | 965 | } |
| 959 | 966 | ||
| 960 | int SrsSource::cycle() | 967 | int SrsSource::cycle() |
| @@ -310,6 +310,10 @@ public: | @@ -310,6 +310,10 @@ public: | ||
| 310 | virtual ~SrsGopCache(); | 310 | virtual ~SrsGopCache(); |
| 311 | public: | 311 | public: |
| 312 | /** | 312 | /** |
| 313 | + * cleanup when system quit. | ||
| 314 | + */ | ||
| 315 | + virtual void dispose(); | ||
| 316 | + /** | ||
| 313 | * to enable or disable the gop cache. | 317 | * to enable or disable the gop cache. |
| 314 | */ | 318 | */ |
| 315 | virtual void set(bool enabled); | 319 | virtual void set(bool enabled); |
-
请 注册 或 登录 后发表评论