mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Keep resources when dispoing to avoid reuse addresses.
This commit is contained in:
parent
9217fad73b
commit
5949eee4f4
1 changed files with 7 additions and 2 deletions
|
@ -272,6 +272,13 @@ void SrsResourceManager::do_clear()
|
|||
|
||||
dispose(conn);
|
||||
}
|
||||
|
||||
// We should free the resources when finished all disposing callbacks,
|
||||
// which might cause context switch and reuse the freed addresses.
|
||||
for (int i = 0; i < (int)copy.size(); i++) {
|
||||
ISrsResource* conn = copy.at(i);
|
||||
srs_freep(conn);
|
||||
}
|
||||
}
|
||||
|
||||
void SrsResourceManager::dispose(ISrsResource* c)
|
||||
|
@ -315,8 +322,6 @@ void SrsResourceManager::dispose(ISrsResource* c)
|
|||
|
||||
h->on_disposing(c);
|
||||
}
|
||||
|
||||
srs_freep(c);
|
||||
}
|
||||
|
||||
ISrsExpire::ISrsExpire()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue