mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Config: Add more utest for env config. v6.0.147 (#4142)
1. don't use static variable to store the result;
2. add more UT to handle the multi value and values with whitespaces;
related to #4092
16e569d823/trunk/src/app/srs_app_config.cpp (L71-L82)
`static SrsConfDirective* dir` removed, this static var here is to avoid
the memory leak, I add the `SrsConfDirective` instance to the `env_dirs`
directive container, which will destroy itself inside `SrsConfig`
destructor.
---------
Co-authored-by: winlin <winlinvip@gmail.com>
This commit is contained in:
parent
957140db51
commit
133a39a81d
5 changed files with 148 additions and 9 deletions
|
@ -305,6 +305,9 @@ private:
|
|||
protected:
|
||||
// The directive root.
|
||||
SrsConfDirective* root;
|
||||
private:
|
||||
// The cache for parsing the config from environment variables.
|
||||
SrsConfDirective* env_cache_;
|
||||
// Reload section
|
||||
private:
|
||||
// The reload subscribers, when reload, callback all handlers.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue