From 9caaf1f1b7aef385355946a99974614ca9586915 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 16 Mar 2016 10:58:00 +0100 Subject: destructor verwenden --- emails.lps | 89 ++++++++++++++++++++++++++++++++++---------------------------- unit1.lfm | 9 ++++--- unit1.pas | 6 +++++ 3 files changed, 60 insertions(+), 44 deletions(-) diff --git a/emails.lps b/emails.lps index ce5a2a2..4c72b2b 100644 --- a/emails.lps +++ b/emails.lps @@ -3,13 +3,13 @@ - + - + @@ -18,20 +18,18 @@ - - - - + + - - - + + + @@ -64,121 +62,132 @@ + + + + + + + + - + - + - + - + - + - + - - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - + - + + + + + diff --git a/unit1.lfm b/unit1.lfm index b874def..60fdbe0 100644 --- a/unit1.lfm +++ b/unit1.lfm @@ -8,6 +8,7 @@ object Form1: TForm1 ClientWidth = 999 OnClose = FormClose OnCreate = FormCreate + OnDestroy = FormDestroy OnResize = FormResize OnShow = FormShow LCLVersion = '1.4.4.0' @@ -72,18 +73,18 @@ object Form1: TForm1 end object CheckBox1: TCheckBox Left = 272 - Height = 21 + Height = 24 Top = 596 - Width = 93 + Width = 98 Caption = 'aufploppen' OnClick = CheckBox1Click TabOrder = 2 end object CheckBox2: TCheckBox Left = 416 - Height = 21 + Height = 24 Top = 596 - Width = 86 + Width = 94 Caption = 'Ton geben' Checked = True OnClick = CheckBox1Click diff --git a/unit1.pas b/unit1.pas index a43430e..7cc71cd 100644 --- a/unit1.pas +++ b/unit1.pas @@ -24,6 +24,7 @@ type procedure CheckBox1Click(Sender: TObject); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); procedure FormResize(Sender: TObject); procedure FormShow(Sender: TObject); procedure TrayIcon1Click(Sender: TObject); @@ -101,6 +102,11 @@ begin pc.port:=995; end; +procedure TForm1.FormDestroy(Sender: TObject); +begin + pc.free; +end; + procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction); begin pc.threadAnhalten; -- cgit v1.2.3-70-g09d2