linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
Subject: [PATCH v2 2/2] media: register disconnect watch at transport add
Date: Tue, 21 Feb 2012 17:46:50 +0100	[thread overview]
Message-ID: <1329842810-13449-3-git-send-email-frederic.dalleau@linux.intel.com> (raw)
In-Reply-To: <1329842810-13449-1-git-send-email-frederic.dalleau@linux.intel.com>

disconnect watch is not removed when the media owner is freed if
an error occurs while resuming in acquire (id == 0).
---
 audio/transport.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/audio/transport.c b/audio/transport.c
index b319e0e..7bf7309 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -599,6 +599,9 @@ static void media_transport_add(struct media_transport *transport,
 	DBG("Transport %s Owner %s", transport->path, owner->name);
 	transport->owners = g_slist_append(transport->owners, owner);
 	owner->transport = transport;
+	owner->watch = g_dbus_add_disconnect_watch(transport->conn, owner->name,
+							media_owner_exit,
+							owner, NULL);
 }
 
 static struct media_owner *media_owner_create(DBusConnection *conn,
@@ -610,9 +613,6 @@ static struct media_owner *media_owner_create(DBusConnection *conn,
 	owner = g_new0(struct media_owner, 1);
 	owner->name = g_strdup(dbus_message_get_sender(msg));
 	owner->accesstype = g_strdup(accesstype);
-	owner->watch = g_dbus_add_disconnect_watch(conn, owner->name,
-							media_owner_exit,
-							owner, NULL);
 
 	DBG("Owner created: sender=%s accesstype=%s", owner->name,
 			accesstype);
-- 
1.7.5.4


  parent reply	other threads:[~2012-02-21 16:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 16:46 [PATCH v2 0/2] gateway: Fix crash if SCO connection fails Frédéric Dalleau
2012-02-21 16:46 ` [PATCH v2 1/2] " Frédéric Dalleau
2012-02-22  8:43   ` Luiz Augusto von Dentz
2012-02-21 16:46 ` Frédéric Dalleau [this message]
2012-02-22  8:42   ` [PATCH v2 2/2] media: register disconnect watch at transport add Luiz Augusto von Dentz
2012-03-08 10:14 ` [PATCH v2 0/2] gateway: Fix crash if SCO connection fails Dalleau, Frederic
2012-03-08 23:58 ` Johan Hedberg

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=1329842810-13449-3-git-send-email-frederic.dalleau@linux.intel.com \
    --to=frederic.dalleau@linux.intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).