]> git.llucax.com Git - software/eventxx.git/commitdiff
Add EVENTXX_NO_WARNING to avoid even_base_free() memory leak warning.
authorLeandro Lucarella <llucax+eventxx@gmail.com>
Fri, 18 May 2007 18:30:51 +0000 (18:30 +0000)
committerLeandro Lucarella <llucax+eventxx@gmail.com>
Fri, 18 May 2007 18:30:51 +0000 (18:30 +0000)
eventxx
test/Makefile

diff --git a/eventxx b/eventxx
index e2391b5026263fc81717360f065f71b0a66cdcec..2ee228dc3221a090f946de0796565c2badcecfcb 100644 (file)
--- 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
        /// 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()."
 #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
 
        /**
 #endif
 
        /**
index 1519df2696f7dc8c485464252ff94263e03ee16b..2969e11b6d98e5f4aa1aae0838bbc4f2db4685c7 100644 (file)
@@ -1,8 +1,13 @@
 
 CXXFLAGS=-I.. -g -Wall
 
 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
 # 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 \
 LDFLAGS=-levent
 
 targets=bench test-eof test-time test-weof trivial c-way functor-way \