pi->height = MAX(1, pc->cd->height * pw->image_size / 100);
pw->cache_list = g_list_remove(pw->cache_list, pc);
- cache_sim_data_free(pc->cd);
- file_data_unref(pc->fd);
- g_free(pc);
+ pan_cache_data_free(pc);
return;
}
}
y += height;
}
}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * cache data
+ *-----------------------------------------------------------------------------
+ */
+
+void pan_cache_data_free(PanCacheData *pc)
+{
+ if (!pc) return;
+
+ cache_sim_data_free(pc->cd);
+ file_data_unref(pc->fd);
+ g_free(pc);
+}
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
PanItem *pan_text_alignment_add(PanTextAlignment *ta, const gchar *label, const gchar *text);
void pan_text_alignment_calc(PanTextAlignment *ta, PanItem *box);
+// Cache data
+void pan_cache_data_free(PanCacheData *pc);
+
#endif
static void pan_cache_free(PanWindow *pw)
{
- g_list_free_full(pw->cache_list, [](gpointer data)
- {
- auto pc = static_cast<PanCacheData *>(data);
- cache_sim_data_free(pc->cd);
- file_data_unref(pc->fd);
- g_free(pc);
- });
+ g_list_free_full(pw->cache_list, reinterpret_cast<GDestroyNotify>(pan_cache_data_free));
pw->cache_list = nullptr;
filelist_free(pw->cache_todo);