Hi,
On Thu, 2013-10-10 at 16:58 +0200, Daniel Wagner wrote:
> +void __connman_service_auto_disconnect(void)
> +{
> + DBG("");
> +
> + if (autodisconnect_timeout != 0)
> + return;
> +
> + autodisconnect_timeout = g_timeout_add_seconds(0,
> run_auto_disconnect, NULL);
> +}
This is unnecessary and complicated. Can't the code just disconnect when
the last session requesting it calls disconnect and it gets removed from
whatever structures? That could be related to removal from service
struct, but unfortunately I'm a little busy checking the code right now.
For disconnection we'd need to track what connected the service, was it
a session, "normal" autoconnect or the user. Only if a session has
requested the service to be connected should the service be disconnected
when the last session disconnects it.
Cheers,
Patrik
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman