On 07/04/15 12:42, Patrik Flykt wrote:
>> @@ -6863,6 +6868,11 @@ void __connman_service_remove_from_network(struct 
>> connman_network *network)
>>      __connman_connection_gateway_remove(service,
>>                                      CONNMAN_IPCONFIG_TYPE_ALL);
>>  
>> +    if (service->network) {
>> +            connman_network_unref(service->network);
>> +            service->network = NULL;
>> +    }
>> +
>>      connman_service_unref(service);
>>  }
>>  
> No network, no service. The network unref is done with
> g_hash_table_remove() in connman_service_unref().
>
> Again Jolla's additional patches break this assumption as you may have
> one more reference for the service not to loose a network-less one from
> the list, right?


The fewer assumptions the better.

The code which calls unref() can't make the assumption that it's the
last reference and the object gets deallocated. Otherwise why would you
use refcount in the first place if you know exactly when to deallocate
the object, right?

I'm reasonably sure that in Jolla code the additional reference is held
by the wispr context. Otherwise it would crash there.

-Slava
_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to