1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-14 11:33:14 +00:00

Hide false memleaks in a debugbuild

This makes sure valgrind doesn't show false memleaks that are caused by ncurses
instead of our code when we do a 'Debug' build. There is a also a disadvantage:
When your ncurses library is not build with the '--disable-leaks' option (this
is the case in the default version of ncurses of most distro's) and you build
conky with ncurses and debug turned on then you will see a segmentation fault
when you stop conky. On the other hand people that want to build conky as a
debug build with ncurses support will probably also have a ncurses with
--disable-leaks ...
This commit is contained in:
Nikolas Garofil 2010-02-19 00:09:24 +01:00
parent c7fa36a5f2
commit f695ed58d9
2 changed files with 17 additions and 0 deletions

View File

@ -66,6 +66,9 @@
#include <getopt.h>
#ifdef BUILD_NCURSES
#include <ncurses.h>
#ifdef DEBUG
#include "nc.h"
#endif
#endif
#ifdef BUILD_WEATHER_XOAP
#include <libxml/parser.h>
@ -4341,6 +4344,9 @@ int main(int argc, char **argv)
kvm_close(kd);
#endif
#if defined(BUILD_NCURSES) && defined(DEBUG)
_nc_free_and_exit(0); //hide false memleaks
#endif
return 0;
}

11
src/nc.h Normal file
View File

@ -0,0 +1,11 @@
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */
#ifdef __cplusplus
extern "C" {
#endif
void _nc_free_and_exit(int);
#ifdef __cplusplus
}
#endif