Skip to content

Commit 8b42abe

Browse files
authored
Merge pull request #539 from Esri/ldanzinger/auth_view_destruction
canceling challenge if there is one present on destruction
2 parents 1370e98 + 0ac50bb commit 8b42abe

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ AuthenticationController::AuthenticationController(QObject* parent) :
8181
*/
8282
AuthenticationController::~AuthenticationController()
8383
{
84+
// cancel the current challenge on destruction to ensure new challenges can be issued
85+
// for future requests (e.g. if AuthenticationView is declared within a StackView)
86+
if (m_currentChallenge)
87+
m_currentChallenge->cancel();
8488
}
8589

8690
/*!

uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/AuthenticationController.qml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,11 @@ QtObject {
163163
}
164164
}
165165
}
166+
167+
// cancel the current challenge on destruction to ensure new challenges can be issued
168+
// for future requests (e.g. if AuthenticationView is declared within a StackView)
169+
Component.onDestruction: {
170+
if (internal.currentChallenge)
171+
internal.currentChallenge.cancel();
172+
}
166173
}

0 commit comments

Comments
 (0)