mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
Refine init of global objects
This commit is contained in:
parent
8b58d18a5a
commit
4cf6da107c
2 changed files with 12 additions and 3 deletions
|
@ -37,6 +37,10 @@
|
|||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
extern ISrsLog* _srs_log;
|
||||
extern ISrsContext* _srs_context;
|
||||
extern SrsConfig* _srs_config;
|
||||
|
||||
extern SrsStageManager* _srs_stages;
|
||||
extern SrsRtcBlackhole* _srs_blackhole;
|
||||
extern SrsResourceManager* _srs_rtc_manager;
|
||||
|
@ -275,6 +279,11 @@ srs_error_t srs_thread_initialize()
|
|||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
// Root global objects.
|
||||
_srs_log = new SrsFileLog();
|
||||
_srs_context = new SrsThreadContext();
|
||||
_srs_config = new SrsConfig();
|
||||
|
||||
// The clock wall object.
|
||||
_srs_clock = new SrsWallClock();
|
||||
|
||||
|
|
|
@ -70,10 +70,10 @@ srs_error_t run_hybrid_server();
|
|||
void show_macro_features();
|
||||
|
||||
// @global log and context.
|
||||
ISrsLog* _srs_log = new SrsFileLog();
|
||||
ISrsContext* _srs_context = new SrsThreadContext();
|
||||
ISrsLog* _srs_log = NULL;
|
||||
ISrsContext* _srs_context = NULL;
|
||||
// @global config object for app module.
|
||||
SrsConfig* _srs_config = new SrsConfig();
|
||||
SrsConfig* _srs_config = NULL;
|
||||
|
||||
// @global version of srs, which can grep keyword "XCORE"
|
||||
extern const char* _srs_version;
|
||||
|
|
Loading…
Reference in a new issue