winlin

fix mem leak detect bug, destroy server when quit

@@ -311,6 +311,11 @@ SrsServer::SrsServer() @@ -311,6 +311,11 @@ SrsServer::SrsServer()
311 311
312 SrsServer::~SrsServer() 312 SrsServer::~SrsServer()
313 { 313 {
  314 + destroy();
  315 +}
  316 +
  317 +void SrsServer::destroy()
  318 +{
314 _srs_config->unsubscribe(this); 319 _srs_config->unsubscribe(this);
315 320
316 if (true) { 321 if (true) {
@@ -538,6 +543,8 @@ int SrsServer::cycle() @@ -538,6 +543,8 @@ int SrsServer::cycle()
538 #ifdef SRS_AUTO_INGEST 543 #ifdef SRS_AUTO_INGEST
539 ingester->stop(); 544 ingester->stop();
540 #endif 545 #endif
  546 +
  547 + destroy();
541 548
542 return ret; 549 return ret;
543 } 550 }
@@ -128,6 +128,7 @@ private: @@ -128,6 +128,7 @@ private:
128 public: 128 public:
129 SrsServer(); 129 SrsServer();
130 virtual ~SrsServer(); 130 virtual ~SrsServer();
  131 + virtual void destroy();
131 public: 132 public:
132 virtual int initialize(); 133 virtual int initialize();
133 virtual int initialize_signal(); 134 virtual int initialize_signal();