单例接口放置在cpp文件中

This commit is contained in:
xiongziliang
2018-07-03 17:10:11 +08:00
parent 35fd682c9a
commit b7304808b3
4 changed files with 18 additions and 11 deletions

View File

@@ -32,6 +32,14 @@ using namespace ZL::Util;
namespace ZL {
namespace Rtsp {
UDPServer &UDPServer::Instance() {
static UDPServer *instance(new UDPServer());
return *instance;
}
void UDPServer::Destory() {
delete &UDPServer::Instance();
}
UDPServer::UDPServer() {
}