From 3fc3bda9ca1a70e37834b9d6567487b1f7ec0191 Mon Sep 17 00:00:00 2001 From: Jamie Vital Date: Sun, 31 Dec 2023 12:17:07 -0500 Subject: [PATCH] Fix some scoping --- android/backend.cpp | 1 + android/main.cpp | 1 - src-interface/loader/loader.cpp | 5 ++--- src-interface/loader/loader.h | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/android/backend.cpp b/android/backend.cpp index 7fbfd4304..4d0349b37 100644 --- a/android/backend.cpp +++ b/android/backend.cpp @@ -1,4 +1,5 @@ #include "core/backend.h" +#include "core/style.h" #include "backend.h" extern EGLDisplay g_EglDisplay; diff --git a/android/main.cpp b/android/main.cpp index 033175540..b0df55028 100644 --- a/android/main.cpp +++ b/android/main.cpp @@ -21,7 +21,6 @@ static float get_dpi(); #include "init.h" #include "main_ui.h" #include "loader/loader.h" -#include "core/style.h" bool was_init = false; diff --git a/src-interface/loader/loader.cpp b/src-interface/loader/loader.cpp index 739577b86..632a17e5e 100644 --- a/src-interface/loader/loader.cpp +++ b/src-interface/loader/loader.cpp @@ -13,7 +13,7 @@ namespace satdump { image::Image image; image.load_png(resources::getResourcePath("icon.png")); - px = new uint8_t[image.width() * image.height() * 4]; + uint8_t *px = new uint8_t[image.width() * image.height() * 4]; memset(px, 255, image.width() * image.height() * 4); if (image.channels() == 4) @@ -34,14 +34,13 @@ namespace satdump image_texture = makeImageTexture(); updateImageTexture(image_texture, (uint32_t*)px, image.width(), image.height()); backend::setIcon(px, image.width(), image.height()); - image.clear(); + delete[] px; push_frame("Initializing"); } LoadingScreenSink::~LoadingScreenSink() { deleteImageTexture(image_texture); - delete[] px; } void LoadingScreenSink::receive(slog::LogMsg log) diff --git a/src-interface/loader/loader.h b/src-interface/loader/loader.h index b928ba636..c515c93b5 100644 --- a/src-interface/loader/loader.h +++ b/src-interface/loader/loader.h @@ -14,6 +14,5 @@ namespace satdump private: float scale; unsigned int image_texture; - uint8_t *px; }; }