[poppler] poppler/qt4/src: poppler-link.cc, 1.6, 1.7 poppler-page.cc, 1.28, 1.29 poppler-qt4.h, 1.38, 1.39 poppler-textbox.cc, 1.2, 1.3

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Nov 19 04:59:50 PST 2006


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

Modified Files:
	poppler-link.cc poppler-page.cc poppler-qt4.h 
	poppler-textbox.cc 
Log Message:
        * qt4/src/poppler-link.cc:
        * qt4/src/poppler-page.cc:
        * qt4/src/poppler-qt4.h:
        * qt4/src/poppler-textbox.cc: Fix memory leaks
        * splash/Splash.cc: Initialize the values of nClipRes


Index: poppler-link.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-link.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- poppler-link.cc	15 Nov 2006 21:07:50 -0000	1.6
+++ poppler-link.cc	19 Nov 2006 12:59:48 -0000	1.7
@@ -31,10 +31,14 @@
 
 	LinkDestination::LinkDestination(const LinkDestinationData &data)
 	{
+		bool deleteDest = false;
 		LinkDest *ld = data.ld;
 		
 		if ( data.namedDest && !ld )
+		{
+			deleteDest = true;
 			ld = data.doc->doc.findDest( data.namedDest );
+		}
 		
 		if (!ld) return;
 		
@@ -72,6 +76,8 @@
 		m_top = topAux;
 		m_right = rightAux;
 		m_bottom = bottomAux;
+		
+		if (deleteDest) delete ld;
 	}
 	
 	LinkDestination::LinkDestination(const QString &description)

Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-page.cc,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- poppler-page.cc	15 Nov 2006 21:07:50 -0000	1.28
+++ poppler-page.cc	19 Nov 2006 12:59:48 -0000	1.29
@@ -340,7 +340,9 @@
   
   for (int i = 0; i < word_list->getLength(); i++) {
     TextWord *word = word_list->get(i);
-    QString string = QString::fromUtf8(word->getText()->getCString());
+    GooString *gooWord = word->getText();
+    QString string = QString::fromUtf8(gooWord->getCString());
+    delete gooWord;
     double xMin, yMin, xMax, yMax;
     word->getBBox(&xMin, &yMin, &xMax, &yMax);
     

Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- poppler-qt4.h	18 Nov 2006 17:08:05 -0000	1.38
+++ poppler-qt4.h	19 Nov 2006 12:59:48 -0000	1.39
@@ -64,6 +64,7 @@
 	 1/72 of an inch.
       */
       TextBox(const QString& text, const QRectF &bBox);
+      ~TextBox();
 
       /**
 	  Returns the text of this text box

Index: poppler-textbox.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-textbox.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- poppler-textbox.cc	1 May 2006 18:33:47 -0000	1.2
+++ poppler-textbox.cc	19 Nov 2006 12:59:48 -0000	1.3
@@ -30,6 +30,11 @@
 	m_data->bBox = bBox;
 }
 
+TextBox::~TextBox()
+{
+	delete m_data;
+}
+
 const QString &TextBox::text() const
 {
 	return m_data->text;



More information about the poppler mailing list