Просмотр исходного кода

Memory leak + Removing unused method

Source commit: afdbfe02e13af730a180a831c4aea8134503ee27
Martin Prikryl 9 лет назад
Родитель
Сommit
8763908626
2 измененных файлов с 4 добавлено и 9 удалено
  1. 4 8
      source/forms/Authenticate.cpp
  2. 0 1
      source/forms/Authenticate.h

+ 4 - 8
source/forms/Authenticate.cpp

@@ -53,7 +53,10 @@ void __fastcall TAuthenticateForm::Init(TTerminal * Terminal)
 //---------------------------------------------------------------------------
 __fastcall TAuthenticateForm::~TAuthenticateForm()
 {
-  ReleaseAsModal(this, FShowAsModalStorage);
+  if (ReleaseAsModal(this, FShowAsModalStorage))
+  {
+    UnhookFormActivation(this);
+  }
 }
 //---------------------------------------------------------------------------
 void __fastcall TAuthenticateForm::ShowAsModal()
@@ -68,13 +71,6 @@ void __fastcall TAuthenticateForm::ShowAsModal()
   HookFormActivation(this);
 }
 //---------------------------------------------------------------------------
-void __fastcall TAuthenticateForm::HideAsModal()
-{
-  ::HideAsModal(this, FShowAsModalStorage);
-
-  UnhookFormActivation(this);
-}
-//---------------------------------------------------------------------------
 void __fastcall TAuthenticateForm::CMShowingChanged(TMessage & Message)
 {
   if (Showing && FShowNoActivate)

+ 0 - 1
source/forms/Authenticate.h

@@ -51,7 +51,6 @@ public:
 
   void __fastcall Init(TTerminal * Terminal);
   void __fastcall ShowAsModal();
-  void __fastcall HideAsModal();
   void __fastcall Log(const UnicodeString Message);
   bool __fastcall PromptUser(TPromptKind Kind, UnicodeString Name, UnicodeString Instructions,
     TStrings * Prompts, TStrings * Results, bool ForceLog, bool StoredCredentialsTried);