From: Leandro Lucarella Date: Fri, 18 May 2007 18:30:51 +0000 (+0000) Subject: Add EVENTXX_NO_WARNING to avoid even_base_free() memory leak warning. X-Git-Tag: 0.5~2 X-Git-Url: https://git.llucax.com/software/eventxx.git/commitdiff_plain/868ab76df09c012534e12b21543affdb14ffea4e?ds=inline Add EVENTXX_NO_WARNING to avoid even_base_free() memory leak warning. --- diff --git a/eventxx b/eventxx index e2391b5..2ee228d 100644 --- a/eventxx +++ b/eventxx @@ -795,11 +795,13 @@ struct dispatcher /// Free dispatcher resources, see @ref Status section for details. ~dispatcher() throw() { event_base_free(_event_base); } #else +#ifndef EVENTXX_NO_WARNING #warning "The dispatcher class *will* leak memory because of a libevent bug, " \ "see http://www.mail-archive.com/libevent-users@monkey.org/msg00110.html " \ "for more info an a patch. If you already have this patch, please " \ "-DEVENTXX_EVENT_BASE_FREE_FIX to your compiler to make this message disappear " \ "and really free the dispatcher memory using event_base_free()." +#endif #endif /** diff --git a/test/Makefile b/test/Makefile index 1519df2..2969e11 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,8 +1,13 @@ CXXFLAGS=-I.. -g -Wall + # Uncomment this if you have a fixed event_base_free(). # See http://www.mail-archive.com/libevent-users@monkey.org/msg00112.html #CXXFLAGS+=-DEVENTXX_EVENT_BASE_FREE_FIX + +# Don't warn me about memory leaks +CXXFLAGS+=-DEVENTXX_NO_WARNING + LDFLAGS=-levent targets=bench test-eof test-time test-weof trivial c-way functor-way \