+ // Wait until the Client instance is destroyed before quitting the event loop
+ return [this]() {
+ quInfo() << "Client shutting down...";
+ connect(_client.get(), SIGNAL(destroyed()), QCoreApplication::instance(), SLOT(quit()));
+ _client.release()->deleteLater();
+ };