[matroska] r824 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-09-18 17:15:11 +0400 (Sat, 18 Sep 2004)
New Revision: 824

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
   trunk/DvdMenuXtractor/VobParser.cpp
   trunk/DvdMenuXtractor/VobParser.h
Log:
fix some internal memory leaks

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-09-18 13:11:05 UTC (rev 823)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-09-18 13:15:11 UTC (rev 824)
@@ -578,11 +578,6 @@
             {
 				if(m_VobParser->IsNewCell())
 				{
-                    if(demuxer)
-                    {
-                        delete demuxer;
-						demuxer = NULL;
-                    }
                     if(IfoFile->IsACandidateCell(m_VobParser->GetVobID(),m_VobParser->GetCellID()))
                     {
                         newFilename = newFilename.Format("cell_V%03d_C%02d",

Modified: trunk/DvdMenuXtractor/VobParser.cpp
===================================================================
--- trunk/DvdMenuXtractor/VobParser.cpp	2004-09-18 13:11:05 UTC (rev 823)
+++ trunk/DvdMenuXtractor/VobParser.cpp	2004-09-18 13:15:11 UTC (rev 824)
@@ -86,6 +86,7 @@
 	fseek(m_file,0,SEEK_END);
 	uint32_t fileSize = ftell(m_file);
 	m_pktcount = fileSize / PACKET_SIZE;
+	m_demuxer = NULL;
 	
 	Reset();
 }
@@ -195,6 +196,8 @@
 
 void VobParser::SetDemuxer(Demuxer* demuxer)
 {
+	if (m_demuxer)
+		delete m_demuxer;
 	m_demuxer = demuxer;
 }
 
@@ -631,6 +634,8 @@
 	previous_cellid = -1;
 	m_index = 0;
 	m_pktindex = 0;
+	if (m_demuxer)
+		delete m_demuxer;
 	m_demuxer = NULL;
 	fseek(m_file, 0, SEEK_SET);
 }

Modified: trunk/DvdMenuXtractor/VobParser.h
===================================================================
--- trunk/DvdMenuXtractor/VobParser.h	2004-09-18 13:11:05 UTC (rev 823)
+++ trunk/DvdMenuXtractor/VobParser.h	2004-09-18 13:15:11 UTC (rev 824)
@@ -446,6 +446,12 @@
 
 	}
 
+	~CellMap()
+	{
+		// clean the hash table
+		Clear();
+	}
+
 	cell_info_node* AddCell(uint8_t vobid = 0, uint8_t cellid = 0)
 	{
 		cell_info_node* newnode = new cell_info_node(vobid,cellid);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.