On Fri, Nov 20, 2009 at 5:05 PM, Haiping Zhao <hz...@facebook.com> wrote:
> When I call event_base_loopexit() with a timeout, and say it’s not
> triggered, because event_base_loopbreak() breaks out of the loop before
> timeout is reached, I saw a memory leak of an event_once object, calloc-ed
> inside event_base_once(), but never got a chance to get freed, because
> free(eonce) is called inside timeout’s callback. How to fix this from
> outside of libevent?

I think the answer is: don't use event_base_loopexit(); it's just
a convenience function.  In this situation it's better to roll your own
by creating an explicit event and adding it yourself, then you have
more control.  See how I did it at
http://codereview.chromium.org/372033/diff/1/3
- Dan
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://lists.monkey.org:8080/listinfo/libevent-users

Reply via email to