|
|
@@ -274,11 +274,10 @@ void __fastcall TTerminalManager::DoConnectTerminal(TTerminal * Terminal, bool R
|
|
|
OwnsObjects = true;
|
|
|
FActiveTerminal = Terminal;
|
|
|
|
|
|
- // when abandoning cancelled terminal, the form remains open
|
|
|
- if (FAuthenticateForm != NULL)
|
|
|
+ // When abandoning cancelled terminal, DoInformation(Phase = 0) does not make it to TerminalInformation handler.
|
|
|
+ if (DebugAlwaysTrue(FAuthenticating > 0))
|
|
|
{
|
|
|
- delete FAuthenticateForm;
|
|
|
- FAuthenticateForm = NULL;
|
|
|
+ AuthenticatingDone();
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -1117,6 +1116,17 @@ void __fastcall TTerminalManager::TerminalCustomCommand(
|
|
|
Handled = CopyCommandToClipboard(Command);
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
+void __fastcall TTerminalManager::AuthenticatingDone()
|
|
|
+{
|
|
|
+ FAuthenticating--;
|
|
|
+ if (FAuthenticating == 0)
|
|
|
+ {
|
|
|
+ BusyEnd(FBusyToken);
|
|
|
+ FBusyToken = NULL;
|
|
|
+ }
|
|
|
+ SAFE_DESTROY(FAuthenticateForm);
|
|
|
+}
|
|
|
+//---------------------------------------------------------------------------
|
|
|
void __fastcall TTerminalManager::TerminalInformation(
|
|
|
TTerminal * Terminal, const UnicodeString & Str, bool /*Status*/, int Phase)
|
|
|
{
|
|
|
@@ -1132,13 +1142,7 @@ void __fastcall TTerminalManager::TerminalInformation(
|
|
|
else if (Phase == 0)
|
|
|
{
|
|
|
DebugAssert(FAuthenticating > 0);
|
|
|
- FAuthenticating--;
|
|
|
- if (FAuthenticating == 0)
|
|
|
- {
|
|
|
- BusyEnd(FBusyToken);
|
|
|
- FBusyToken = NULL;
|
|
|
- }
|
|
|
- SAFE_DESTROY(FAuthenticateForm);
|
|
|
+ AuthenticatingDone();
|
|
|
}
|
|
|
else
|
|
|
{
|