static void smartcard_manager_init_helper(GSimpleAsyncResult *res, GObject *object, GCancellable *cancellable) { SpiceSession *session = SPICE_SESSION(object); GError *err = NULL; if (!smartcard_manager_init(session, cancellable, &err)) { g_simple_async_result_set_from_error(res, err); g_error_free(err); } }
static void smartcard_manager_init_helper(GSimpleAsyncResult *res, GObject *object, GCancellable *cancellable) { static GOnce smartcard_manager_once = G_ONCE_INIT; SmartcardManagerInitArgs args; args.session = SPICE_SESSION(object); args.cancellable = cancellable; args.err = NULL; g_once(&smartcard_manager_once, (GThreadFunc)smartcard_manager_init, &args); if (args.err != NULL) { g_simple_async_result_set_from_error(res, args.err); g_error_free(args.err); } }