aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/symbols-extract.tes
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2023-07-03 04:27:49 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2023-07-03 04:27:49 +0300
commit41a02591b9d199a82bb24c23f3828102375137de (patch)
treed09d8a10eb2ed5d180a945421b933f673ce7a95c /src/symbols-extract.tes
parent69b4bbb8341cfda5d8456ccbf951034d63e4340c (diff)
downloadsciteco-41a02591b9d199a82bb24c23f3828102375137de.tar.gz
introduced TECO_DEBUG_CLEANUP to mark destructors that should only be used for debug builds
* There is cleanup that is not strictly necessary, because it only frees memory which is freed on program termination anyway. * However, it helps to explicitly free everything for debugging memory leaks via Valgrind. * The new macro reduces the number of #ifdef statements. * On NDEBUG, the code of these functions will still be eliminated. * If functions are referenced only from the destructor, there will be no unused function warnings, even in NDEBUG.
Diffstat (limited to 'src/symbols-extract.tes')
-rwxr-xr-xsrc/symbols-extract.tes5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/symbols-extract.tes b/src/symbols-extract.tes
index 9f43fa6..9b55e93 100755
--- a/src/symbols-extract.tes
+++ b/src/symbols-extract.tes
@@ -48,13 +48,12 @@ teco_symbols_init(void)
teco_symbol_list_init(&Q[getopt.n], entries, G_N_ELEMENTS(entries), FALSE);
}
-#ifndef NDEBUG
-static void __attribute__((destructor))
+static void TECO_DEBUG_CLEANUP
teco_cmdline_cleanup(void)
{
teco_symbol_list_clear(&Q[getopt.n]);
}
-#endif^J
+
!* write output file *!
2EL EWQ#ou