summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2024-03-08 09:38:15 +0100
committerDave Davenport <qball@gmpclient.org>2024-03-08 09:38:15 +0100
commitaf6fb83a51821cc980196418e464afca5058cb00 (patch)
treef4b6fd04bfb0d9ef0dea379e35daf2c7fd179934
parent0bf0c5182765723579ff2535390d59b1d8be4647 (diff)
[View] Work around GThreadPool 1 pointer bug.
* Also fix typo in icon fetcher.
-rw-r--r--source/rofi-icon-fetcher.c2
-rw-r--r--source/view.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/source/rofi-icon-fetcher.c b/source/rofi-icon-fetcher.c
index 1fd37004..ef19bf5f 100644
--- a/source/rofi-icon-fetcher.c
+++ b/source/rofi-icon-fetcher.c
@@ -94,7 +94,7 @@ static void rofi_icon_fetch_entry_free(gpointer data);
IconFetcher *rofi_icon_fetcher_data = NULL;
static void rofi_icon_fetch_thread_pool_entry_remove(gpointer data) {
- IconFetcherNameEntry *entry = (IconFetcherNameEntry *)data;
+ IconFetcherEntry *entry = (IconFetcherEntry *)data;
// Mark it in a way it should be re-fetched on next query?
}
static void rofi_icon_fetch_entry_free(gpointer data) {
diff --git a/source/view.c b/source/view.c
index 3e463a67..aac8c22e 100644
--- a/source/view.c
+++ b/source/view.c
@@ -2653,6 +2653,15 @@ static int rofi_thread_workers_sort(gconstpointer a, gconstpointer b,
static void rofi_thread_pool_state_free(gpointer data) {
if (data) {
+ // This is a weirdness from glib that should not happen.
+ // It pushes in a 1 to msg sleeping threads to wake up.
+ // This should be removed from queue to avoid hitting this method.
+ // In practice, we still hit it (and crash)
+ if (GPOINTER_TO_UINT(data) == 1) {
+ // Ignore this entry.
+ g_debug("Glib thread-pool bug, received pointer with value 1.");
+ return;
+ }
thread_state *ts = (thread_state *)data;
if (ts->free) {
ts->free(data);