Mem leak fixed
This commit is contained in:
parent
31ad924b46
commit
c373136679
2 changed files with 8 additions and 1 deletions
|
@ -45,6 +45,12 @@ namespace OGG{
|
|||
dataSum = 0;
|
||||
}
|
||||
|
||||
Page::~Page(){
|
||||
if (data){
|
||||
free(data);
|
||||
}
|
||||
}
|
||||
|
||||
bool Page::read(std::string & newData){
|
||||
segmentTableDeque.clear();
|
||||
//datasize = 0;
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace OGG{
|
|||
class Page{
|
||||
public:
|
||||
Page();
|
||||
~Page();
|
||||
bool read(std::string & newData);
|
||||
long unsigned int getMagicNumber();
|
||||
void setMagicNumber();
|
||||
|
@ -49,7 +50,7 @@ namespace OGG{
|
|||
private:
|
||||
std::deque<unsigned int> segmentTableDeque;
|
||||
char* data;//pointer to the beginning of the Page data
|
||||
unsigned int datasize;//size of the complete page
|
||||
unsigned int datasize;//size of the allocated memory
|
||||
unsigned int dataSum;//size of the total segments
|
||||
bool checkDataSize(unsigned int size);
|
||||
std::string codec;//codec in the page
|
||||
|
|
Loading…
Add table
Reference in a new issue