1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-27 00:58:36 +00:00

Make hiding ncurses memleaks optional and disable it by default

This commit is contained in:
Nikolas Garofil 2010-02-19 13:21:40 +01:00
parent f695ed58d9
commit 0627946ca1
3 changed files with 8 additions and 2 deletions

View File

@ -87,6 +87,11 @@ option(BUILD_BUILTIN_CONFIG "Enable builtin default configuration" true)
option(BUILD_MATH "Enable math support" true)
option(BUILD_NCURSES "Enable ncurses support" true)
if(BUILD_NCURSES)
option(LEAKFREE_NCURSES "Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)" false)
else(BUILD_NCURSES)
set(LEAKFREE_NCURSES false CACHE BOOL "Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)" FORCE)
endif(BUILD_NCURSES)
option(BUILD_X11 "Build X11 support" true)
if(BUILD_X11)

View File

@ -78,6 +78,7 @@
#cmakedefine BUILD_BUILTIN_CONFIG 1
#cmakedefine BUILD_NCURSES 1
#cmakedefine LEAKFREE_NCURSES 1
#cmakedefine BUILD_APCUPSD 1

View File

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