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"));
return;
}
//se filtran para obtener sólo los formatos soportados
_order = archive.getFileNames();
_fileNames = filter(_order);

View File

@ -171,10 +171,11 @@ CompressedArchive::CompressedArchive(const QString & filePath, QObject *parent)
CompressedArchive::~CompressedArchive()
{
#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();
#endif
delete szInterface;
if(valid) //TODO: fix this!!! Memory leak.
delete szInterface;
#ifdef Q_OS_UNIX
delete rarLib;
#endif