From a76dabb12734154177a78033324b40365e7c6f21 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 21 Jul 2021 14:46:48 +0200 Subject: Fix freeze on search reset in manga combined plugin. Fix multithreading issues in AsyncTask --- plugins/MangaCombined.hpp | 1 + plugins/Page.hpp | 1 + 2 files changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/MangaCombined.hpp b/plugins/MangaCombined.hpp index 5dc4850..dafc884 100644 --- a/plugins/MangaCombined.hpp +++ b/plugins/MangaCombined.hpp @@ -23,6 +23,7 @@ namespace QuickMedia { PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; sf::Vector2i get_thumbnail_max_size() override { return sf::Vector2i(101, 141); }; + void cancel_operation() override; private: std::vector search_pages; std::vector search_threads; // TODO: Use async task pool diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 35e778b..07d4e0d 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -57,6 +57,7 @@ namespace QuickMedia { // This is called both when first navigating to page and when going back to page virtual void on_navigate_to_page(Body *body) { (void)body; } + virtual void cancel_operation() {} std::unique_ptr create_body(bool plain_text_list = false, bool prefer_card_view = false); std::unique_ptr create_search_bar(const std::string &placeholder_text, int search_delay); -- cgit v1.2.3