From 087807447f17bba1b47daee8aed2a24c25573e9f Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 10 Apr 2025 15:43:41 +0200 Subject: [PATCH] Fix default icon export --- base/tools/amake/aimage.c | 11 +++++++++++ base/tools/make.js | 16 ++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/base/tools/amake/aimage.c b/base/tools/amake/aimage.c index 215cfdec..51d22362 100644 --- a/base/tools/amake/aimage.c +++ b/base/tools/amake/aimage.c @@ -112,6 +112,17 @@ void export_ico(const char *from, const char *to) { fwrite(png48, 1, png48_len, file); fwrite(png256, 1, png256_len, file); fclose(file); + + free(data256); + free(data48); + free(data32); + free(data24); + free(data16); + free(png256); + free(png48); + free(png32); + free(png24); + free(png16); } void export_png(const char *from, const char *to, int width, int height) { diff --git a/base/tools/make.js b/base/tools/make.js index 7d4aef1f..6ea7eb31 100644 --- a/base/tools/make.js +++ b/base/tools/make.js @@ -2225,24 +2225,24 @@ class CompilerCommandsExporter extends Exporter { // ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ function export_ico(icon, to, from) { + if (!fs_exists(path_join(from, icon))) { + from = irondir; + icon = "icon.png"; + } if (fs_exists(to) && fs_mtime(to) > fs_mtime(from)) { return; } - if (!fs_exists(path_join(from, icon))) { - from = makedir; - icon = "icon.png"; - } amake.export_ico(path_join(from, icon), to); } function export_png_icon(icon, to, width, height, from) { + if (!fs_exists(path_join(from, icon))) { + from = irondir; + icon = "icon.png"; + } if (fs_exists(to) && fs_mtime(to) > fs_mtime(from)) { return; } - if (!fs_exists(path_join(from, icon))) { - from = makedir; - icon = "icon.png"; - } amake.export_png(path_join(from, icon), to, width, height); }