Hello Black,

Sunday, June 7, 2009, 3:58:50 PM, you wrote:

> Hi, there

> I found there are 256 bytes still reachable after ev_default_destroy():

> Valgrind log:

> ==1878== 256 bytes in 1 blocks are still reachable in loss record 1 of 2
> ==1878==    at 0x4025868: malloc (vg_replace_malloc.c:207)
> ==1878==    by 0x40259AC: realloc (vg_replace_malloc.c:429)
> ==1878==    by 0x804B675: ev_realloc (ev.c:467)
> ==1878==    by 0x804EFD8: ev_signal_start (ev.c:2477)
> ==1878==    by 0x804F1B5: ev_default_loop_init (ev.c:1724)
> ==1878==    by 0x8051357: SchedulerLibEv::SchedulerLibEv(char const*)
> (ev.h:454)
> ==1878==    by 0x804A2A7: main (test-timer-libev.cpp:80)
> ==1878==

> ev.c

> struct ANSIG *signals;

> alloced in ev_default_loop() -> ev_signal_init () ...

> but not freed in ev_default_destroy() -> ev_signal_stop ()

> Patch is attached.

More proper patch is attached.

-- 
Best regards,
 Denis                            mailto:[email protected]
Index: ev.c
===================================================================
RCS file: /schmorpforge/libev/ev.c,v
retrieving revision 1.289
diff -u -r1.289 ev.c
--- ev.c        6 Jun 2009 11:13:16 -0000       1.289
+++ ev.c        19 Jun 2009 14:19:08 -0000
@@ -1746,6 +1746,8 @@
   ev_signal_stop (EV_A_ &childev);
 #endif
 
+  ev_free (signals);
+
   loop_destroy (EV_A);
 }
 
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to