From: Johan Hedberg <johan.hedberg@gmail.com>
To: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ 1/6] Make use of g_slist_free_full when elements are dynamically-allocated
Date: Wed, 29 Jun 2011 23:18:33 +0300 [thread overview]
Message-ID: <20110629201833.GA11241@dell.ger.corp.intel.com> (raw)
In-Reply-To: <BANLkTika3jp4Y2vyU-PWpgf+oDBX_xgN_Q@mail.gmail.com>
Hi Lucas,
On Wed, Jun 29, 2011, Lucas De Marchi wrote:
> Another thing that I think it'd be nice to use is
> g_io_channel_set_close_on_unref() instead of unref() + shutdown() in
> several places. What do you think?
You need to be careful with that since those two methods are not
identical: unref() + shutdown() will close the link immediately, whereas
close_on_unref() + unref() will not do anything (except the unref) if
there are any other references around. E.g. all IO callbacks own a
reference to the GIOChannel so doing a simple unref() on the GIOChannel
elsewhere will not actually close the link even if close_on_unref is
TRUE.
There are several places which expect the IO callback to check for
G_IO_NVAL and return FALSE if set (thereby removing the IO callback and
its GIOChannel reference). The only way you'd be able to convert such
cases is to change the unref() + shutdown() to a unref() +
g_source_remove(). However, this would eliminate most/some of the
simplification gain you're trying to accomplish.
Johan
prev parent reply other threads:[~2011-06-29 20:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 8:52 [PATCH BlueZ 1/6] Make use of g_slist_free_full when elements are dynamically-allocated Luiz Augusto von Dentz
2011-06-29 8:52 ` [PATCH BlueZ 2/6] Make use of g_slist_free_full on attrib Luiz Augusto von Dentz
2011-06-29 8:52 ` [PATCH BlueZ 3/6] Make use of g_slist_free_full on audio plugin Luiz Augusto von Dentz
2011-06-29 8:52 ` [PATCH BlueZ 4/6] Make use of g_slist_free_full on network plugin Luiz Augusto von Dentz
2011-06-29 8:52 ` [PATCH BlueZ 5/6] Make use of g_slist_free_full on serial plugin Luiz Augusto von Dentz
2011-06-29 8:52 ` [PATCH BlueZ 6/6] Make use of g_slist_free_full on hciops plugin Luiz Augusto von Dentz
2011-06-29 18:57 ` [PATCH BlueZ 1/6] Make use of g_slist_free_full when elements are dynamically-allocated Lucas De Marchi
2011-06-29 20:18 ` 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=20110629201833.GA11241@dell.ger.corp.intel.com \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=luiz.dentz@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).