1
0
Fork 0
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:
winlin 2020-12-21 11:56:22 +08:00
parent 9217fad73b
commit 5949eee4f4

View file

@ -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()