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

fix the global static instance error, use function to get server

This commit is contained in:
winlin 2013-11-20 10:08:52 +08:00
parent c79372417d
commit d1e20dc866
4 changed files with 28 additions and 14 deletions

View file

@ -171,6 +171,7 @@ SrsServer::SrsServer()
{
signal_reload = false;
srs_assert(config);
config->subscribe(this);
}
@ -328,5 +329,8 @@ int SrsServer::on_reload_listen()
return listen();
}
SrsServer server;
SrsServer* _server()
{
static SrsServer server;
return &server;
}

View file

@ -89,6 +89,6 @@ public:
virtual int on_reload_listen();
};
extern SrsServer server;
SrsServer* _server();
#endif