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