1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Fix #1524, memory leak for amf0 strict array. 3.0.75

This commit is contained in:
winlin 2019-12-19 14:39:34 +08:00
parent 1e4f22f83d
commit 49c737f996
4 changed files with 12 additions and 10 deletions

View file

@ -27,7 +27,7 @@
// The version config.
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION 74
#define VERSION_REVISION 75
// The macros generated by configure script.
#include <srs_auto_headers.hpp>

View file

@ -1030,12 +1030,7 @@ SrsAmf0StrictArray::SrsAmf0StrictArray()
SrsAmf0StrictArray::~SrsAmf0StrictArray()
{
std::vector<SrsAmf0Any*>::iterator it;
for (it = properties.begin(); it != properties.end(); ++it) {
SrsAmf0Any* any = *it;
srs_freep(any);
}
properties.clear();
clear();
}
int SrsAmf0StrictArray::total_size()
@ -1147,6 +1142,11 @@ SrsJsonAny* SrsAmf0StrictArray::to_json()
void SrsAmf0StrictArray::clear()
{
std::vector<SrsAmf0Any*>::iterator it;
for (it = properties.begin(); it != properties.end(); ++it) {
SrsAmf0Any* any = *it;
srs_freep(any);
}
properties.clear();
}

View file

@ -356,7 +356,7 @@ public:
* convert amf0 to json.
*/
virtual SrsJsonAny* to_json();
// properties iteration
// properties iteration
public:
/**
* clear all propergies.
@ -447,7 +447,7 @@ public:
* convert amf0 to json.
*/
virtual SrsJsonAny* to_json();
// properties iteration
// properties iteration
public:
/**
* clear all propergies.
@ -532,7 +532,7 @@ public:
* convert amf0 to json.
*/
virtual SrsJsonAny* to_json();
// properties iteration
// properties iteration
public:
/**
* clear all elements.