From f5dc7e2c85436877606af46a011c2fba112185a9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 18 Oct 2020 06:54:18 +0200 Subject: Fix potential crash in thumbnail loader: 2 --- include/AsyncImageLoader.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/AsyncImageLoader.hpp') diff --git a/include/AsyncImageLoader.hpp b/include/AsyncImageLoader.hpp index fe8d52a..fa32971 100644 --- a/include/AsyncImageLoader.hpp +++ b/include/AsyncImageLoader.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include namespace QuickMedia { enum class LoadingState { @@ -23,15 +23,13 @@ namespace QuickMedia { class AsyncImageLoader { public: - ~AsyncImageLoader(); // Returns false if the image loader is already loading an image. In that case, this function should be called again later. // set |resize_target_size| to {0, 0} to disable resizing. // |thumbnail_data.loading_state| has to be LoadingState::NOT_LOADED when calling this! // Note: this method is not thread-safe bool load_thumbnail(const std::string &url, bool local, sf::Vector2i resize_target_size, bool use_tor, std::shared_ptr thumbnail_data); - void update(); private: bool loading_image = false; - std::future load_image_future; + std::thread load_image_thread; }; } \ No newline at end of file -- cgit v1.2.3