Mem leak fixed

This commit is contained in:
Oswald Auguste de Bruin 2013-09-03 09:53:27 +02:00
parent 31ad924b46
commit c373136679
2 changed files with 8 additions and 1 deletions

View file

@ -45,6 +45,12 @@ namespace OGG{
dataSum = 0;
}
Page::~Page(){
if (data){
free(data);
}
}
bool Page::read(std::string & newData){
segmentTableDeque.clear();
//datasize = 0;

View file

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