mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
SmartPtr: Use shared ptr to manage GB objects. v6.0.126 (#4080)
The object relations:

Session manages SIP and Media object using shared resource or shared
ptr. Note that I actually use SrsExecutorCoroutine to delete the object
when each coroutine is done, because there is always a dedicate
coroutine for each object.
For SIP and Media object, they directly use the session by raw pointer,
it's safe because session always live longer than session and media
object.
---
Co-authored-by: Jacob Su <suzp1984@gmail.com>
This commit is contained in:
parent
1656391c67
commit
6834ec208d
15 changed files with 989 additions and 464 deletions
|
@ -413,28 +413,6 @@ void SrsResourceManager::dispose(ISrsResource* c)
|
|||
}
|
||||
}
|
||||
|
||||
SrsLazySweepGc::SrsLazySweepGc()
|
||||
{
|
||||
}
|
||||
|
||||
SrsLazySweepGc::~SrsLazySweepGc()
|
||||
{
|
||||
}
|
||||
|
||||
srs_error_t SrsLazySweepGc::start()
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
return err;
|
||||
}
|
||||
|
||||
void SrsLazySweepGc::remove(SrsLazyObject* c)
|
||||
{
|
||||
// TODO: FIXME: MUST lazy sweep.
|
||||
srs_freep(c);
|
||||
}
|
||||
|
||||
ISrsLazyGc* _srs_gc = NULL;
|
||||
|
||||
ISrsExpire::ISrsExpire()
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue