From 2d111bd3e0ea4d459fd6a5b25baf380616024d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Tue, 28 Jan 2014 11:37:52 -0800 Subject: [PATCH] fixed crash after open CompressedArchive fail --- common/comic.cpp | 1 + compressed_archive/compressed_archive.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/comic.cpp b/common/comic.cpp index e651055e..880edd32 100644 --- a/common/comic.cpp +++ b/common/comic.cpp @@ -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); diff --git a/compressed_archive/compressed_archive.cpp b/compressed_archive/compressed_archive.cpp index 79f994d3..aad9edee 100644 --- a/compressed_archive/compressed_archive.cpp +++ b/compressed_archive/compressed_archive.cpp @@ -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