Hi Luiz, On Mon, Dec 20, 2010 at 5:20 AM, Luiz Augusto von Dentz <luiz.dentz@xxxxxxxxx> wrote: > While I see the reference problem I don't really see how this could > help since the application doesn't know about internal watches only > the reference returned, so if the application releases its references > btio won't release its own and in fact it can still call the > application callbacks. Sorry, but I don't understand the issue you describe here. The watch created by e.g. bt_io_listen() needs to be destroyed at some point, otherwise any destroy callbacks registered by the btio users will never be called, and the reference added by the watch itself is not decremented. You can see this by running valgrind with --leak-check=yes with/without these patches. Doing this during the daemon shutdown seems a good place, as it will do other memory deallocations anyway. Regards, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html