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

Refine resource manager, ignore unsubscribed handler

This commit is contained in:
winlin 2020-10-02 09:13:41 +08:00
parent c120e954f5
commit 776f24cf3d
4 changed files with 214 additions and 28 deletions

View file

@ -62,6 +62,10 @@ private:
srs_cond_t cond;
// Callback handlers.
std::vector<ISrsDisposingHandler*> handlers_;
// Unsubscribing handlers, skip it for notifying.
std::vector<ISrsDisposingHandler*> unsubs_;
// Whether we are removing resources.
bool removing_;
// The zombie connections, we will delete it asynchronously.
std::vector<ISrsResource*> zombies_;
std::vector<ISrsResource*>* p_disposing_;
@ -96,6 +100,7 @@ public:
public:
virtual void remove(ISrsResource* c);
private:
void do_remove(ISrsResource* c);
void clear();
void do_clear();
void dispose(ISrsResource* c);