mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Clear disposing then free resources to avoid reuse addresses
This commit is contained in:
parent
e8fa92e3d1
commit
764909c6cf
1 changed files with 5 additions and 3 deletions
|
@ -261,9 +261,6 @@ void SrsResourceManager::clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
do_clear();
|
do_clear();
|
||||||
|
|
||||||
// Reset it for it points to a local object.
|
|
||||||
p_disposing_ = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsResourceManager::do_clear()
|
void SrsResourceManager::do_clear()
|
||||||
|
@ -286,6 +283,11 @@ void SrsResourceManager::do_clear()
|
||||||
dispose(conn);
|
dispose(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset it for it points to a local object.
|
||||||
|
// @remark We must set the disposing to NULL to avoid reusing address,
|
||||||
|
// because the context might switch.
|
||||||
|
p_disposing_ = NULL;
|
||||||
|
|
||||||
// We should free the resources when finished all disposing callbacks,
|
// We should free the resources when finished all disposing callbacks,
|
||||||
// which might cause context switch and reuse the freed addresses.
|
// which might cause context switch and reuse the freed addresses.
|
||||||
for (int i = 0; i < (int)copy.size(); i++) {
|
for (int i = 0; i < (int)copy.size(); i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue