Commit 3f0679a3 authored by Albert Astals Cid's avatar Albert Astals Cid

Patch by Pino Toscano <pino@kde.org> to fix some memory leaks when dealing with sounds.

parent d41cd2f5
2007-01-06 Albert Astals Cid <aacid@kde.org>
* poppler/Sound.cc
* qt4/src/poppler-link.cc
* qt4/src/poppler-link.h
* qt4/src/poppler-page.cc
* qt4/src/poppler-sound.cc: Patch by Pino Toscano
<pino@kde.org> to fix some memory leaks when dealing with sounds.
2007-01-04 Albert Astals Cid <aacid@kde.org>
* qt4/src/poppler-private.h: gmallocn -> new[]
......
......@@ -57,6 +57,7 @@ Sound::Sound(Object *obj)
Sound::~Sound()
{
streamObj->free();
delete streamObj;
}
Stream *Sound::getStream()
......
......@@ -258,6 +258,11 @@ namespace Poppler {
{
}
LinkSound::~LinkSound()
{
delete m_sound;
}
Link::LinkType LinkSound::linkType() const
{
return Sound;
......
......@@ -215,6 +215,7 @@ class LinkSound : public Link
public:
// create a Link_Sound
LinkSound( const QRectF &linkArea, double volume, bool sync, bool repeat, bool mix, SoundObject *sound );
virtual ~LinkSound();
LinkType linkType() const;
......
......@@ -398,9 +398,13 @@ Link *Page::action( PageAction act ) const
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;
......
......@@ -39,6 +39,12 @@ public:
: 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(const SoundObject &s)
SoundObject::~SoundObject()
{
m_soundData->m_soundObj->free();
delete m_soundData;
}
......
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