wifi-manager: Clear gdbus connection after it is unref'd 68/179068/1 submit/tizen/20180516.084045 submit/tizen/20180517.074802
authorSaurav Babu <saurav.babu@samsung.com>
Tue, 15 May 2018 11:38:32 +0000 (17:08 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Tue, 15 May 2018 11:38:32 +0000 (17:08 +0530)
commit2d09f8403787a86779e0296727bae6bc60f19b6f
tree3d1bf6f9e4dfd7ef9f10edd8520c3e832febb38f
parente918bf7db6fc8c96a247739d111a7c4598cb0457
wifi-manager: Clear gdbus connection after it is unref'd

In the below scenario:
 1. Initalize wifi manager
 2. Start WiFi Scan (or any other asynchronous method)
 3. Deinitialize wifi manager before asynchronous method is finished

At the time of deinitialization pending calls exist and gdbus connection
is unref'd but it is not cleared to NULL, so in future initializations
gdbus connection handle is corrupted and wifi_manager_initialize() is
failed.

https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-object-unref
states that if pointer to the GObject may be reused in future after
calling g_object_unref() then it is recommended to clear the pointer to
NULL rather than retain a dangling pointer to a potentially invalid
GObject instance using g_clear_object()

Change-Id: I36aa1184afed01c1dbc0779722239f262fb890f4
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/network_internal.c