@@ -53,16 +53,15 @@ public:
53 this, SLOT(handlePrompt(QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)));
53 this, SLOT(handlePrompt(QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)));
56 void start(QString username)
61 void start(QString username)
58− // Clear out any existing PAM interactions first (we can't simply
63+ // Clear out any existing PAM interactions first
59− // cancel our QFuture because QtConcurrent::run doesn't support cancel)
64+ cancelPam();
60− if (pamHandle != NULL) {
61− pam_handle *handle = pamHandle;
62− pamHandle = NULL; // to disable normal finishPam() handling
63− while (respond(QString())); // clear our local queue of QFutures
64− pam_end(handle, PAM_CONV_ERR);
67 // Now actually start a new conversation with PAM
66 // Now actually start a new conversation with PAM
68 pam_conv conversation;
67 pam_conv conversation;
@@ -212,6 +211,17 @@ private Q_SLOTS:
216+ // Unfortunately we can't simply cancel our QFuture because QtConcurrent::run doesn't support cancel
217+ if (pamHandle != NULL) {
218+ pam_handle *handle = pamHandle;
219+ pamHandle = NULL; // to disable normal finishPam() handling
220+ while (respond(QString())); // clear our local queue of QFutures
221+ pam_end(handle, PAM_CONV_ERR);
215 Greeter *greeter;
225 Greeter *greeter;
216 GreeterPrivate *greeterPrivate;
226 GreeterPrivate *greeterPrivate;
217 pam_handle* pamHandle;
227 pam_handle* pamHandle;