Commit c0029ac3 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Fix small mem leaks

svn path=/trunk/kdegraphics/kpdf/; revision=379484
parent c277d16b
......@@ -88,6 +88,16 @@ KPDFDocument::KPDFDocument()
KPDFDocument::~KPDFDocument()
{
closeDocument();
ObserverData *o;
QMap< int, ObserverData * >::iterator oIt;
while (d->observers.count() > 0)
{
oIt = d->observers.begin();
o = *oIt;
d->observers.remove(oIt);
delete o;
}
delete d;
}
......
......@@ -114,7 +114,9 @@ const QString KPDFPage::getTextInRect( const QRect & rect, double zoom ) const
right = (int)((double)rect.right() / zoom),
bottom = (int)((double)rect.bottom() / zoom);
GString * text = m_text->getText( left, top, right, bottom );
return QString::fromUtf8( text->getCString() );
QString result = QString::fromUtf8( text->getCString() );
delete text;
return result;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment