diff options
author | Thomas Haller <thaller@redhat.com> | 2017-06-21 15:34:34 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-06-28 20:36:56 +0200 |
commit | 182996cd2e3b87729c1508ad3018fb542c943cc1 (patch) | |
tree | 243f223c11b66bb39fc82acfd77487e35f0ba4d8 | |
parent | 612efd3d4ed7923512ea8192d9cd4506f4524c61 (diff) | |
download | NetworkManager-182996cd2e3b87729c1508ad3018fb542c943cc1.tar.gz |
libnm: move check for pending_init to init_async_complete()
-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 d9ea5cc95c..ee9418ce60 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); |