On 10/23/2014 08:04 AM, Patrik Flykt wrote:
This is caused because there are two plugins for Bluetooth, one for Bluez 4 and the other one for Bluez 5. Both register a connman_technology_driver. So far so good. The problem is caused by technology_get(type) in __connman_technology_add_rfkill(), with more than one technology driver this add function is called multiple times, each time increasing the reference count of the technology by one. It's not that easy to fix, as the technology is created when there is a technology driver present and either an rfkill switch or a connman device is added to the system. While I'm thinking on how to solve this, the UI mopping up after a sudden ConnMan disappearance from D-Bus looks suddenly like a very good and easy solution to the initial problem...
I see what you mean. I guess the reason my initial patch seemed like it works is because there was only one extra technology_get called. If there were three Bluetooth drivers, then it would not work.

It seems like you might be able to have an rfkill_get and rfkill_put so that the first driver that is registered that calls rfkill_get will call __connman_technology_add_rfkill, but subsequent calls to rfkill_get will just return without calling __connman_technology_add_rfkill. When the last driver is unregistered that calls rfkill_put, then it should in turn call __connman_technology_remove_rfkill. Of course, rfkill_process in src/rfkill.c would have to be modified to work with this as well.
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to