[poppler] poppler/qt4/src: poppler-link.cc, 1.7, 1.8 poppler-link.h, 1.5, 1.6 poppler-page.cc, 1.31, 1.32 poppler-sound.cc, 1.1, 1.2

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Jan 6 13:53:10 PST 2007


Update of /cvs/poppler/poppler/qt4/src
In directory kemper:/tmp/cvs-serv20446/qt4/src

Modified Files:
	poppler-link.cc poppler-link.h poppler-page.cc 
	poppler-sound.cc 
Log Message:
Patch by Pino Toscano <pino at kde.org> to fix some memory leaks when dealing with sounds.


Index: poppler-link.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-link.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- poppler-link.cc	19 Nov 2006 12:59:48 -0000	1.7
+++ poppler-link.cc	6 Jan 2007 21:53:08 -0000	1.8
@@ -258,6 +258,11 @@
 	{
 	}
 	
+	LinkSound::~LinkSound()
+	{
+		delete m_sound;
+	}
+	
 	Link::LinkType LinkSound::linkType() const
 	{
 		return Sound;

Index: poppler-link.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-link.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- poppler-link.h	16 Nov 2006 21:03:27 -0000	1.5
+++ poppler-link.h	6 Jan 2007 21:53:08 -0000	1.6
@@ -215,6 +215,7 @@
 	public:
 		// create a Link_Sound
 		LinkSound( const QRectF &linkArea, double volume, bool sync, bool repeat, bool mix, SoundObject *sound );
+		virtual ~LinkSound();
 
 		LinkType linkType() const;
 

Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-page.cc,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- poppler-page.cc	26 Dec 2006 20:07:03 -0000	1.31
+++ poppler-page.cc	6 Jan 2007 21:53:08 -0000	1.32
@@ -398,9 +398,13 @@
     dict->lookup(key, &o2);
     ::LinkAction *act = ::LinkAction::parseAction(&o2, m_page->parentDoc->m_doc->doc.getCatalog()->getBaseURI() );
     o2.free();
+    o.free();
     Link *popplerLink = NULL;
     if (act != NULL)
+    {
       popplerLink = m_page->convertLinkActionToLink(act, QRectF(), m_page->parentDoc->m_doc);
+      delete act;
+    }
     return popplerLink;
   }
   return 0;

Index: poppler-sound.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-sound.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- poppler-sound.cc	8 Oct 2006 20:38:47 -0000	1.1
+++ poppler-sound.cc	6 Jan 2007 21:53:08 -0000	1.2
@@ -39,6 +39,12 @@
 	  : m_channels( 1 ), m_bitsPerSample( 8 ), m_soundEncoding( SoundObject::Raw ), m_soundObj( new Object() )
 	{ m_soundObj->initNull(); }
 
+	~SoundData()
+	{
+		m_soundObj->free();
+		delete m_soundObj;
+	}
+
 	QVariant m_data;
 	SoundObject::SoundType m_type;
 	double m_samplingRate;
@@ -135,7 +141,6 @@
 
 SoundObject::~SoundObject()
 {
-	m_soundData->m_soundObj->free();
 	delete m_soundData;
 }
 



More information about the poppler mailing list