I don't think we should leak memory without holding a static pointer root to
it, otherwise Valgrind will report it as definitely lost (rather than possibly
lost). So if we want this then either `g_intern_string` or this:
```c
static const gchar *labels[10];
int n;
for (n = 1; n != 10; n++)
labels[n] = g_strdup_printf(_("Send to Custom Command %d"), n);
ADD_KB_CUSTOM_COMMAND(1, GDK_1, GEANY_PRIMARY_MOD_MASK);
...
```
I think the macro is not so bad if it only wraps `add_kb` and allocation is
done outside it.
(It's a shame there's no `g_string_chunk_insert_printf`).
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1058#issuecomment-293511898