* [PATCH BlueZ] GAttrib: Add debug message for GAttrib references
@ 2012-02-09 15:41 Claudio Takahasi
2012-02-09 15:41 ` [PATCH BlueZ] GAttrib: Fix leak when remote disconnects Claudio Takahasi
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Claudio Takahasi @ 2012-02-09 15:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
Makefile.tools | 2 +-
attrib/gattrib.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Makefile.tools b/Makefile.tools
index eea1a9b..19a4b04 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -59,7 +59,7 @@ bin_PROGRAMS += attrib/gatttool
attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
attrib/gattrib.c btio/btio.c \
attrib/gatttool.h attrib/interactive.c \
- attrib/utils.c
+ attrib/utils.c src/log.c
attrib_gatttool_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @READLINE_LIBS@
endif
diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 4d901f1..ccddabe 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -31,6 +31,7 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/uuid.h>
+#include "log.h"
#include "att.h"
#include "btio.h"
#include "gattrib.h"
@@ -147,6 +148,8 @@ GAttrib *g_attrib_ref(GAttrib *attrib)
g_atomic_int_inc(&attrib->refs);
+ DBG("%p: ref=%d", attrib, attrib->refs);
+
return attrib;
}
@@ -205,10 +208,16 @@ static void attrib_destroy(GAttrib *attrib)
void g_attrib_unref(GAttrib *attrib)
{
+ gboolean ret;
+
if (!attrib)
return;
- if (g_atomic_int_dec_and_test(&attrib->refs) == FALSE)
+ ret = g_atomic_int_dec_and_test(&attrib->refs);
+
+ DBG("%p: ref=%d", attrib, attrib->refs);
+
+ if (ret == FALSE)
return;
attrib_destroy(attrib);
--
1.7.8.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH BlueZ] GAttrib: Fix leak when remote disconnects
2012-02-09 15:41 [PATCH BlueZ] GAttrib: Add debug message for GAttrib references Claudio Takahasi
@ 2012-02-09 15:41 ` Claudio Takahasi
2012-02-09 15:55 ` Johan Hedberg
2012-02-09 15:41 ` [PATCH BlueZ] device: Remove unused variable Claudio Takahasi
2012-02-09 15:54 ` [PATCH BlueZ] GAttrib: Add debug message for GAttrib references Johan Hedberg
2 siblings, 1 reply; 6+ messages in thread
From: Claudio Takahasi @ 2012-02-09 15:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
attrib/gattrib.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index ccddabe..12a9fcf 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -193,10 +193,11 @@ static void attrib_destroy(GAttrib *attrib)
if (attrib->write_watch > 0)
g_source_remove(attrib->write_watch);
- if (attrib->read_watch > 0) {
+ if (attrib->read_watch > 0)
g_source_remove(attrib->read_watch);
+
+ if (attrib->io)
g_io_channel_unref(attrib->io);
- }
g_free(attrib->buf);
--
1.7.8.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH BlueZ] device: Remove unused variable
2012-02-09 15:41 [PATCH BlueZ] GAttrib: Add debug message for GAttrib references Claudio Takahasi
2012-02-09 15:41 ` [PATCH BlueZ] GAttrib: Fix leak when remote disconnects Claudio Takahasi
@ 2012-02-09 15:41 ` Claudio Takahasi
2012-02-09 15:55 ` Johan Hedberg
2012-02-09 15:54 ` [PATCH BlueZ] GAttrib: Add debug message for GAttrib references Johan Hedberg
2 siblings, 1 reply; 6+ messages in thread
From: Claudio Takahasi @ 2012-02-09 15:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/device.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/src/device.c b/src/device.c
index ac2a93c..3f4ac76 100644
--- a/src/device.c
+++ b/src/device.c
@@ -83,7 +83,6 @@ struct btd_disconnect_data {
struct bonding_req {
DBusConnection *conn;
DBusMessage *msg;
- GIOChannel *io;
guint listener_id;
struct btd_device *device;
};
@@ -2217,9 +2216,6 @@ static void bonding_request_free(struct bonding_req *bonding)
if (bonding->conn)
dbus_connection_unref(bonding->conn);
- if (bonding->io)
- g_io_channel_unref(bonding->io);
-
device = bonding->device;
g_free(bonding);
--
1.7.8.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH BlueZ] GAttrib: Add debug message for GAttrib references
2012-02-09 15:41 [PATCH BlueZ] GAttrib: Add debug message for GAttrib references Claudio Takahasi
2012-02-09 15:41 ` [PATCH BlueZ] GAttrib: Fix leak when remote disconnects Claudio Takahasi
2012-02-09 15:41 ` [PATCH BlueZ] device: Remove unused variable Claudio Takahasi
@ 2012-02-09 15:54 ` Johan Hedberg
2 siblings, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2012-02-09 15:54 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Thu, Feb 09, 2012, Claudio Takahasi wrote:
> ---
> Makefile.tools | 2 +-
> attrib/gattrib.c | 11 ++++++++++-
> 2 files changed, 11 insertions(+), 2 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH BlueZ] GAttrib: Fix leak when remote disconnects
2012-02-09 15:41 ` [PATCH BlueZ] GAttrib: Fix leak when remote disconnects Claudio Takahasi
@ 2012-02-09 15:55 ` Johan Hedberg
0 siblings, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2012-02-09 15:55 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Thu, Feb 09, 2012, Claudio Takahasi wrote:
> ---
> attrib/gattrib.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH BlueZ] device: Remove unused variable
2012-02-09 15:41 ` [PATCH BlueZ] device: Remove unused variable Claudio Takahasi
@ 2012-02-09 15:55 ` Johan Hedberg
0 siblings, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2012-02-09 15:55 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Thu, Feb 09, 2012, Claudio Takahasi wrote:
> ---
> src/device.c | 4 ----
> 1 files changed, 0 insertions(+), 4 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-02-09 15:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-09 15:41 [PATCH BlueZ] GAttrib: Add debug message for GAttrib references Claudio Takahasi
2012-02-09 15:41 ` [PATCH BlueZ] GAttrib: Fix leak when remote disconnects Claudio Takahasi
2012-02-09 15:55 ` Johan Hedberg
2012-02-09 15:41 ` [PATCH BlueZ] device: Remove unused variable Claudio Takahasi
2012-02-09 15:55 ` Johan Hedberg
2012-02-09 15:54 ` [PATCH BlueZ] GAttrib: Add debug message for GAttrib references Johan Hedberg
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).