From 9c3c23daa6d3a70921f3aeb3560c81b497065eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signed-off-by=3A=20Henrik=20Rydg=C3=A5rd?= Date: Tue, 2 Apr 2024 13:48:16 +0300 Subject: [PATCH] Fixed memleaks and incorrect add tab in ui::view_group Signed-off-by: Herman Semenov --- Common/File/VFS/ZipFileReader.cpp | 1 + UI/DevScreens.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Common/File/VFS/ZipFileReader.cpp b/Common/File/VFS/ZipFileReader.cpp index 5597ad358d..c25b17f680 100644 --- a/Common/File/VFS/ZipFileReader.cpp +++ b/Common/File/VFS/ZipFileReader.cpp @@ -281,6 +281,7 @@ VFSOpenFile *ZipFileReader::OpenFileForRead(VFSFileReference *vfsReference, size if (!openFile->zf) { WARN_LOG(G3D, "File with index %d not found in zip", reference->zi); lock_.unlock(); + delete openFile; return nullptr; } diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 829f1a9357..72d68e06ac 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -1395,7 +1395,7 @@ void FrameDumpTestScreen::CreateViews() { LinearLayout *dumps = new LinearLayoutList(ORIENT_VERTICAL); dumps->SetSpacing(0); dumpsScroll->Add(dumps); - tabHolder->AddTab("Dumps", dumps); + tabHolder->AddTab("Dumps", dumpsScroll); dumps->Add(new ItemHeader("GE Frame Dumps")); @@ -1405,6 +1405,7 @@ void FrameDumpTestScreen::CreateViews() { c->SetTag(url); c->OnClick.Handle(this, &FrameDumpTestScreen::OnLoadDump); } + delete dumpsScroll; } UI::EventReturn FrameDumpTestScreen::OnLoadDump(UI::EventParams ¶ms) {