aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-07 02:33:11 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-07 02:33:11 +0100
commit9539a71dbeafdc4107d3b92eefada332ee45579a (patch)
tree65b8ceb183ee939f9684a783a40fc0f8fe5fd860 /src/plugins
parent9f12d8a7f6e4cdf0cb95130b69da2b368cc9cbb5 (diff)
Manga: fix crashes when navigating from/to creators page/bookmarks page (shared ptr deinit in non-main thread deiniting gl resources in non main thread), add pgup/pgdown/home/end to navigate manga faster
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/MangaCombined.cpp4
-rw-r--r--src/plugins/MangaGeneric.cpp5
-rw-r--r--src/plugins/Mangadex.cpp5
-rw-r--r--src/plugins/Page.cpp6
-rw-r--r--src/plugins/Soundcloud.cpp4
5 files changed, 19 insertions, 5 deletions
diff --git a/src/plugins/MangaCombined.cpp b/src/plugins/MangaCombined.cpp
index f678e57..06ecfc0 100644
--- a/src/plugins/MangaCombined.cpp
+++ b/src/plugins/MangaCombined.cpp
@@ -123,7 +123,9 @@ namespace QuickMedia {
Page *page = (Page*)submit_body_item->userdata;
if(!page) return PluginResult::OK;
page->submit_body_item = submit_body_item;
- return page->submit(title, url, result_tabs);
+ PluginResult result = page->submit(title, url, result_tabs);
+ page->submit_body_item = nullptr;
+ return result;
}
void MangaCombinedSearchPage::cancel_operation() {
diff --git a/src/plugins/MangaGeneric.cpp b/src/plugins/MangaGeneric.cpp
index 0c1ee37..e8d8992 100644
--- a/src/plugins/MangaGeneric.cpp
+++ b/src/plugins/MangaGeneric.cpp
@@ -406,7 +406,10 @@ namespace QuickMedia {
}
PluginResult MangaGenericCreatorPage::submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) {
- return search_page->submit(title, url, result_tabs);
+ search_page->submit_body_item = submit_body_item;
+ PluginResult result = search_page->submit(title, url, result_tabs);
+ search_page->submit_body_item = nullptr;
+ return result;
}
PluginResult MangaGenericCreatorPage::lazy_fetch(BodyItems &result_items) {
diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp
index 88f4c18..79341bd 100644
--- a/src/plugins/Mangadex.cpp
+++ b/src/plugins/Mangadex.cpp
@@ -386,7 +386,10 @@ namespace QuickMedia {
}
PluginResult MangadexCreatorPage::submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) {
- return search_page->submit(title, url, result_tabs);
+ search_page->submit_body_item = submit_body_item;
+ PluginResult result = search_page->submit(title, url, result_tabs);
+ search_page->submit_body_item = nullptr;
+ return result;
}
PluginResult MangadexCreatorPage::get_page(const std::string&, int page, BodyItems &result_items) {
diff --git a/src/plugins/Page.cpp b/src/plugins/Page.cpp
index 2e3caf4..c7b0bb3 100644
--- a/src/plugins/Page.cpp
+++ b/src/plugins/Page.cpp
@@ -72,7 +72,11 @@ namespace QuickMedia {
}
PluginResult BookmarksPage::submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) {
- return redirect_page->submit(title, url, result_tabs);
+ // TODO: Find a better solution to not keep the submit body item alive
+ redirect_page->submit_body_item = submit_body_item;
+ PluginResult result = redirect_page->submit(title, url, result_tabs);
+ redirect_page->submit_body_item = nullptr;
+ return result;
}
PluginResult BookmarksPage::lazy_fetch(BodyItems &result_items) {
diff --git a/src/plugins/Soundcloud.cpp b/src/plugins/Soundcloud.cpp
index fa37e29..7f2b1f1 100644
--- a/src/plugins/Soundcloud.cpp
+++ b/src/plugins/Soundcloud.cpp
@@ -288,7 +288,9 @@ namespace QuickMedia {
PluginResult SoundcloudSearchPage::submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) {
submit_page.submit_body_item = submit_body_item;
- return submit_page.submit(title, url, result_tabs);
+ PluginResult result = submit_page.submit(title, url, result_tabs);
+ submit_page.submit_body_item = nullptr;
+ return result;
}
SearchResult SoundcloudSearchPage::search(const std::string &str, BodyItems &result_items) {