mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
fixed memory leak in CompressedArchive
This commit is contained in:
parent
adcd9f820d
commit
3125190184
@ -406,10 +406,6 @@ QList<QVector<quint32> > FileComic::getSections(int & sectionIndex)
|
|||||||
|
|
||||||
void FileComic::process()
|
void FileComic::process()
|
||||||
{
|
{
|
||||||
QTime myTimer;
|
|
||||||
myTimer.start();
|
|
||||||
// do something..
|
|
||||||
|
|
||||||
CompressedArchive archive(_path);
|
CompressedArchive archive(_path);
|
||||||
//se filtran para obtener sólo los formatos soportados
|
//se filtran para obtener sólo los formatos soportados
|
||||||
_order = archive.getFileNames();
|
_order = archive.getFileNames();
|
||||||
@ -459,7 +455,7 @@ void FileComic::process()
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
emit imagesLoaded();
|
emit imagesLoaded();
|
||||||
moveToThread(QApplication::instance()->thread());
|
//moveToThread(QApplication::instance()->thread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -642,7 +642,7 @@ void Render::createComic(const QString & path)
|
|||||||
{
|
{
|
||||||
if(comic!=0)
|
if(comic!=0)
|
||||||
{
|
{
|
||||||
comic->moveToThread(QApplication::instance()->thread());
|
//comic->moveToThread(QApplication::instance()->thread());
|
||||||
comic->disconnect();
|
comic->disconnect();
|
||||||
comic->deleteLater();
|
comic->deleteLater();
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,9 @@ CompressedArchive::CompressedArchive(const QString & filePath, QObject *parent)
|
|||||||
|
|
||||||
CompressedArchive::~CompressedArchive()
|
CompressedArchive::~CompressedArchive()
|
||||||
{
|
{
|
||||||
//TODO
|
//szInterface->fileSpec->Release();
|
||||||
|
delete szInterface;
|
||||||
|
delete sevenzLib;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompressedArchive::loadFunctions()
|
void CompressedArchive::loadFunctions()
|
||||||
@ -206,9 +208,7 @@ QByteArray CompressedArchive::getRawDataAtIndex(int index)
|
|||||||
qDebug() << "Extract Error" << endl;
|
qDebug() << "Extract Error" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray rawData((char *)extractCallbackSpec->data,extractCallbackSpec->newFileSize);
|
return QByteArray((char *)extractCallbackSpec->data,extractCallbackSpec->newFileSize);
|
||||||
|
|
||||||
return rawData;
|
|
||||||
}
|
}
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
@ -92,6 +92,7 @@ public:
|
|||||||
UInt64 newFileSize;
|
UInt64 newFileSize;
|
||||||
|
|
||||||
CArchiveExtractCallback(bool c = false,ExtractDelegate * d = 0) : PasswordIsDefined(false),all(c),delegate(d) {}
|
CArchiveExtractCallback(bool c = false,ExtractDelegate * d = 0) : PasswordIsDefined(false),all(c),delegate(d) {}
|
||||||
|
~CArchiveExtractCallback() {MidFree(data);}
|
||||||
};
|
};
|
||||||
|
|
||||||
void CArchiveExtractCallback::Init(IInArchive *archiveHandler, const UString &directoryPath)
|
void CArchiveExtractCallback::Init(IInArchive *archiveHandler, const UString &directoryPath)
|
||||||
@ -259,6 +260,7 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 operationResult)
|
|||||||
{
|
{
|
||||||
QByteArray rawData((char *)data,newFileSize);
|
QByteArray rawData((char *)data,newFileSize);
|
||||||
MidFree(data);
|
MidFree(data);
|
||||||
|
data = 0;
|
||||||
if(delegate != 0)
|
if(delegate != 0)
|
||||||
delegate->fileExtracted(_index,rawData);
|
delegate->fileExtracted(_index,rawData);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user