From: Johan Hedberg <johan.hedberg@gmail.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/3] Fix memory leak in src/rfkill.c
Date: Mon, 20 Dec 2010 10:16:22 +0200 [thread overview]
Message-ID: <20101220081622.GA3002@jh-x301> (raw)
In-Reply-To: <1292819346-27318-1-git-send-email-anderson.lizardo@openbossa.org>
Hi Lizardo,
On Mon, Dec 20, 2010, Anderson Lizardo wrote:
> Watches must be removed with g_source_remove() otherwise they leak a
> reference count to the GIOChannel and internal memory allocations.
>
> Also g_io_channel_set_close_on_unref() is used, so there is no need to
> call g_io_channel_shutdown() by hand.
You do realize that the watch gets freed and removed from the main
context when the callback function returns FALSE, right? The only case
for all of these patches where you'd have unfreed memory is when you
stop iterating the mainloop while still having the sockets open (or even
if you close them during the very last iteration), i.e. when bluetoothd
is exiting. Is that the problem you're trying to fix here, i.e. getting
rid of unnecessary "noise" in the valgrind leak report?
Johan
prev parent reply other threads:[~2010-12-20 8:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 4:29 [PATCH 1/3] Fix memory leak in src/rfkill.c Anderson Lizardo
2010-12-20 4:29 ` [PATCH 2/3] Fix memory leak in src/sdpd-server.c Anderson Lizardo
2010-12-20 4:29 ` [PATCH 3/3] Fix memory leaks in btio/btio.c Anderson Lizardo
2010-12-20 9:20 ` Luiz Augusto von Dentz
2010-12-20 11:36 ` Anderson Lizardo
2010-12-20 11:57 ` Anderson Lizardo
2010-12-20 8:16 ` Johan Hedberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101220081622.GA3002@jh-x301 \
--to=johan.hedberg@gmail.com \
--cc=anderson.lizardo@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox