mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine code
This commit is contained in:
parent
f83a47a0fc
commit
55696ce871
3 changed files with 42 additions and 38 deletions
|
@ -290,11 +290,11 @@ void SrsSharedPtrMessage::wrap(char* payload, int size)
|
|||
void SrsSharedPtrMessage::unwrap()
|
||||
{
|
||||
if (ptr) {
|
||||
if (ptr->shared_count == 0) {
|
||||
srs_freep(ptr);
|
||||
} else {
|
||||
if (ptr->shared_count > 0) {
|
||||
ptr->shared_count--;
|
||||
ptr = NULL;
|
||||
} else {
|
||||
srs_freep(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue