summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-07-30 18:50:17 +0200
committerDavid Tardon <dtardon@redhat.com>2014-08-01 10:21:31 +0200
commit787ed0a267bc1e8256fe4f38158be2225ae9b6c9 (patch)
tree7992c50792f17a351964f3e83c8f11482d5a0320 /sdext
parente644bb59ff57430193c8abb7470cd1c058d6154c (diff)
avoid memory leak
Change-Id: I9ac97c4e5c7b01b5e05cb1132c0d245f5843799e
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index c6294cc9f4a4..d80ef66719cc 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <boost/scoped_ptr.hpp>
+
#include "pdfioutdev_gpl.hxx"
#ifdef WNT
# include <io.h>
@@ -142,7 +144,7 @@ int main(int argc, char **argv)
}
else
{
- pdfi::PDFOutDev* pOutDev( new pdfi::PDFOutDev(&aDoc) );
+ boost::scoped_ptr<pdfi::PDFOutDev> pOutDev( new pdfi::PDFOutDev(&aDoc) );
// tell receiver early - needed for proper progress calculation
pOutDev->setPageNum( aDoc.getNumPages() );
@@ -154,12 +156,12 @@ int main(int argc, char **argv)
const int nPages = aDoc.getNumPages();
for( int i=1; i<=nPages; ++i )
{
- aDoc.displayPage( pOutDev,
+ aDoc.displayPage( pOutDev.get(),
i,
PDFI_OUTDEV_RESOLUTION,
PDFI_OUTDEV_RESOLUTION,
0, gTrue, gTrue, gTrue );
- aDoc.processLinks( pOutDev, i );
+ aDoc.processLinks( pOutDev.get(), i );
}
}
return 0;