diff options
author | Dave Davenport <qball@blame.services> | 2024-03-01 15:28:48 +0100 |
---|---|---|
committer | Dave Davenport <qball@blame.services> | 2024-03-01 15:28:48 +0100 |
commit | 8061e4e7c2856c4e37e91072c0462ef9cd2e2db4 (patch) | |
tree | ee3fd5eb515343acb067d5dd3e7ea51152dc61b3 /source/rofi-icon-fetcher.c | |
parent | 42d6bb9af4aafa8d7147191fcc887d15c0ab46a4 (diff) |
Add an item-free method to the thread-pool
Diffstat (limited to 'source/rofi-icon-fetcher.c')
-rw-r--r-- | source/rofi-icon-fetcher.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/rofi-icon-fetcher.c b/source/rofi-icon-fetcher.c index e3d6f4dd..397e06fd 100644 --- a/source/rofi-icon-fetcher.c +++ b/source/rofi-icon-fetcher.c @@ -86,6 +86,8 @@ typedef struct { IconFetcherNameEntry *entry; } IconFetcherEntry; +// Free method. +static void rofi_icon_fetch_entry_free(gpointer data); /** * The icon fetcher internal state. */ @@ -361,7 +363,7 @@ static void rofi_icon_fetcher_worker(thread_state *sdata, icon_path, sentry->wsize, sentry->hsize, TRUE, &error); if (error != NULL) { g_warning("Failed to load image: |%s| %d %d %s (%p)", icon_path, - sentry->wsize, sentry->hsize, error->message, (void*)pb); + sentry->wsize, sentry->hsize, error->message, (void *)pb); g_error_free(error); if (pb) { g_object_unref(pb); @@ -411,6 +413,7 @@ uint32_t rofi_icon_fetcher_query_advanced(const char *name, const int wsize, // Push into fetching queue. sentry->state.callback = rofi_icon_fetcher_worker; + sentry->state.free = rofi_icon_fetch_entry_free; sentry->state.priority = G_PRIORITY_LOW; g_thread_pool_push(tpool, sentry, NULL); |