fixed crash after open CompressedArchive fail

This commit is contained in:
Luis Ángel San Martín 2014-01-28 11:37:52 -08:00
parent b38a71136c
commit 2d111bd3e0
2 changed files with 4 additions and 2 deletions

View File

@ -424,6 +424,7 @@ void FileComic::process()
emit errorOpening(tr("Format not supported")); emit errorOpening(tr("Format not supported"));
return; return;
} }
//se filtran para obtener sólo los formatos soportados //se filtran para obtener sólo los formatos soportados
_order = archive.getFileNames(); _order = archive.getFileNames();
_fileNames = filter(_order); _fileNames = filter(_order);

View File

@ -171,9 +171,10 @@ CompressedArchive::CompressedArchive(const QString & filePath, QObject *parent)
CompressedArchive::~CompressedArchive() CompressedArchive::~CompressedArchive()
{ {
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
if(isRar) //TODO: fix this!!! Posible memory leak. If AddRef is not used, a crash occurs in "delete szInterface" if(isRar) //TODO: fix this!!! Possible memory leak. If AddRef is not used, a crash occurs in "delete szInterface"
szInterface->archive->AddRef(); szInterface->archive->AddRef();
#endif #endif
if(valid) //TODO: fix this!!! Memory leak.
delete szInterface; delete szInterface;
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
delete rarLib; delete rarLib;