1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine main object(server, config, log, context), handler reload in intialize(), change to 0.9.59

This commit is contained in:
winlin 2014-04-12 20:35:40 +08:00
parent 7c64a893f5
commit b38df9cd1a
8 changed files with 90 additions and 63 deletions

View file

@ -160,9 +160,6 @@ SrsServer::SrsServer()
signal_reload = false;
signal_gmc_stop = false;
srs_assert(_srs_config);
_srs_config->subscribe(this);
// donot new object in constructor,
// for some global instance is not ready now,
// new these objects in initialize instead.
@ -208,6 +205,12 @@ int SrsServer::initialize()
{
int ret = ERROR_SUCCESS;
// for the main objects(server, config, log),
// never subscribe handler in constructor,
// instead, subscribe handler in initialize method.
srs_assert(_srs_config);
_srs_config->subscribe(this);
#ifdef SRS_HTTP_API
srs_assert(!http_api_handler);
http_api_handler = SrsHttpHandler::create_http_api();