All the leaks.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3919 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-06-26 18:25:31 +00:00
parent 66ea0dadd0
commit ff2a0f0c3f
9 changed files with 50 additions and 24 deletions

View File

@ -15,6 +15,7 @@
#include <xopt.h>
#include <string.h>
#include <valgrind/memcheck.h>
#if !defined(_WIN32) && !defined(__MACH__)
#include <signal.h>
@ -624,6 +625,11 @@ static int _tf_command_usage(const char* file, int argc, char* argv[])
return 0;
}
static void _do_leak_checks(int sig)
{
VALGRIND_DO_LEAK_CHECK;
}
int main(int argc, char* argv[])
{
#if !defined(_WIN32)
@ -639,6 +645,10 @@ int main(int argc, char* argv[])
{
perror("signal");
}
if (signal(SIGHUP, _do_leak_checks) == SIG_ERR)
{
perror("signal");
}
#endif
if (argc >= 2)