diff options
author | Thomas Haller <thaller@redhat.com> | 2017-06-21 15:34:34 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-06-29 10:03:03 +0200 |
commit | a90ab3a401795f56f776e6955e99b270ac00df9f (patch) | |
tree | 9380ba48928be8f20e9906cecbb2db0634d40e13 | |
parent | 5a489ef03eb21c5d0e6bdbe1eede6ed9f093b4a5 (diff) | |
download | NetworkManager-a90ab3a401795f56f776e6955e99b270ac00df9f.tar.gz |
libnm: move check for pending_init to init_async_complete()
(cherry picked from commit a73e73eae140ba88843e7a3dce6dfed03119c699)
-rw-r--r-- | libnm/nm-client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libnm/nm-client.c b/libnm/nm-client.c index 11f0ee4d43..0cd7e5768c 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -2326,6 +2326,8 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) static void init_async_complete (NMClientInitData *init_data) { + if (init_data->pending_init > 0) + return; g_simple_async_result_complete (init_data->result); g_object_unref (init_data->result); g_clear_object (&init_data->cancellable); @@ -2344,8 +2346,7 @@ async_inited_obj_nm (GObject *object, GAsyncResult *result, gpointer user_data) g_simple_async_result_take_error (init_data->result, error); init_data->pending_init--; - if (init_data->pending_init == 0) - init_async_complete (init_data); + init_async_complete (init_data); } static void @@ -2459,8 +2460,7 @@ got_object_manager (GObject *object, GAsyncResult *result, gpointer user_data) g_list_free_full (objects, g_object_unref); } - if (init_data->pending_init == 0) - init_async_complete (init_data); + init_async_complete (init_data); g_signal_connect (priv->object_manager, "notify::name-owner", G_CALLBACK (name_owner_changed), client); |