From b78201060b29c6242fc492e8afc0db2cdcb65e15 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 6 May 2018 02:02:15 +0300 Subject: [PATCH] [app] Fixed a few memory leaks --- app/src/BooksPageWidget.cpp | 4 ++-- app/src/ZLibrary.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/BooksPageWidget.cpp b/app/src/BooksPageWidget.cpp index 2000087..208717d 100644 --- a/app/src/BooksPageWidget.cpp +++ b/app/src/BooksPageWidget.cpp @@ -123,11 +123,11 @@ void BooksPageWidget::ResetTask::performTask() view->gotoPosition(iPosition); if (!isCanceled()) { iData->iView = view; - } else { - delete view; + return; } } } + delete view; } } diff --git a/app/src/ZLibrary.cpp b/app/src/ZLibrary.cpp index 4f61a77..7c03558 100644 --- a/app/src/ZLibrary.cpp +++ b/app/src/ZLibrary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2017 Jolla Ltd. + * Copyright (C) 2015-2018 Jolla Ltd. * Contact: Slava Monich * * You may use this file under the terms of the BSD license as follows: @@ -51,6 +51,8 @@ #include "time/ZLQtTime.h" #include "image/ZLQtImageManager.h" #include "iconv/IConvEncodingConverter.h" +#include "formats/xhtml/XHTMLReader.h" +#include "library/Tag.h" #include #include @@ -244,6 +246,8 @@ void ZLibrary::shutdown() ZLFSManager::deleteInstance(); ZLTimeManager::deleteInstance(); BooksStorageManager::deleteInstance(); + XHTMLReader::clearTagTable(); + Tag::clearTags(); } void ZLibrary::initApplication(const std::string& aName)