[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] evtimer_new "leak"
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] evtimer_new "leak"
- From: Michael Herf <herf@xxxxxxxxx>
- Date: Mon, 06 Oct 2014 16:50:13 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Mon, 06 Oct 2014 19:58:58 -0400
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :date:from:mime-version:to:subject:content-type :content-transfer-encoding; s=sasl; bh=n80tUg7zqk+7me324pZxj3TmA Rs=; b=H8Uo2p8rCzZb9SyLWgmz+KqH10sTAanWSMjqWvB4UaLvPHblIE+Orbyoz X5THJ0sHiMTqrRxsrInKQBdCqRGKAjqUlW+/OU754PMmKLU0nyLt2MhaWksfVm4z Pku+WzSK+/A0CeA3tquSwxUTLl2UFaJ1soZeLpFdTQy9ZmHptU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=pobox.com; h=message-id:date :from:mime-version:to:subject:content-type :content-transfer-encoding; q=dns; s=sasl; b=bGH7HT10QAwmaITwbEm KD+9xfAuUMdQIG3cVQF0sFbceDsRVh6gFcMx/h4e9LO/brj6Z4Pp9VvgYgwMAkKO t39zEnv0RbQhvpbG8I9FoOieLLgt7uhOuqhzXa3PWN4uJEBbMa1k1Sm/8El+CByk FS4Bdox95ETyk6gDecpA9FQ4=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
- User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
I wrote some code that was leaking on every call to evtimer_new -- I was
definitely calling evtimer_del afterwards (sometimes before the timer
fired).
To fix the leak, I found out I actually needed to call event_free,
instead. Took me a while to go read the libevent code and figure this out.
This seems kinda confusing API-wise, and if my understanding of it is
correct, adding an "evtimer_free" macro (also, evsignal_free, ...) or a
better explanation could save people some time.
Michael
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.