ofono: Delay ipconfig structure cleanup
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 17 Dec 2010 11:14:30 +0000 (12:14 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 17 Dec 2010 11:14:30 +0000 (12:14 +0100)
Cleaning the structure before calling connman_network_set_connected(FALSE)
prevents the gateways from being properly freed.

plugins/ofono.c

index 4379625..0a13b7b 100644 (file)
@@ -1516,10 +1516,11 @@ static void set_connected(struct connman_network *network,
        case CONNMAN_IPCONFIG_METHOD_FIXED:
                connman_network_set_ipv4_method(network, method);
 
+               connman_network_set_connected(network, connected);
+
                if (connected == FALSE)
                        cleanup_ipconfig(network);
 
-               connman_network_set_connected(network, connected);
                break;
 
        case CONNMAN_IPCONFIG_METHOD_DHCP: