mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 16:40:48 +02:00
Examples: fix memoryleak in ResExplorer
git-svn-id: trunk@49559 -
This commit is contained in:
parent
0e0621ae82
commit
a931d80679
@ -9,8 +9,9 @@ object reMainForm: TreMainForm
|
|||||||
ClientWidth = 768
|
ClientWidth = 768
|
||||||
Menu = MainMenu1
|
Menu = MainMenu1
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.3'
|
LCLVersion = '1.5'
|
||||||
object TreeView1: TTreeView
|
object TreeView1: TTreeView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 506
|
Height = 506
|
||||||
@ -35,11 +36,11 @@ object reMainForm: TreMainForm
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object tabString: TTabSheet
|
object tabString: TTabSheet
|
||||||
Caption = 'String'
|
Caption = 'String'
|
||||||
ClientHeight = 480
|
ClientHeight = 478
|
||||||
ClientWidth = 467
|
ClientWidth = 467
|
||||||
object StringGrid1: TStringGrid
|
object StringGrid1: TStringGrid
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 480
|
Height = 478
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 467
|
Width = 467
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -128,14 +129,15 @@ object reMainForm: TreMainForm
|
|||||||
end
|
end
|
||||||
object ToolButton3: TToolButton
|
object ToolButton3: TToolButton
|
||||||
Left = 176
|
Left = 176
|
||||||
|
Height = 22
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 10
|
Width = 8
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'ToolButton3'
|
Caption = 'ToolButton3'
|
||||||
Style = tbsSeparator
|
Style = tbsSeparator
|
||||||
end
|
end
|
||||||
object ToolButton4: TToolButton
|
object ToolButton4: TToolButton
|
||||||
Left = 186
|
Left = 184
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = hlpAbout
|
Action = hlpAbout
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
@ -44,6 +44,7 @@ type
|
|||||||
procedure fileExitExecute(Sender: TObject);
|
procedure fileExitExecute(Sender: TObject);
|
||||||
procedure fileOpenExecute(Sender: TObject);
|
procedure fileOpenExecute(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
procedure HeaderControl1SectionResize(HeaderControl: TCustomHeaderControl;
|
procedure HeaderControl1SectionResize(HeaderControl: TCustomHeaderControl;
|
||||||
Section: THeaderSection);
|
Section: THeaderSection);
|
||||||
procedure hlpAboutExecute(Sender: TObject);
|
procedure hlpAboutExecute(Sender: TObject);
|
||||||
@ -103,6 +104,11 @@ begin
|
|||||||
Splitter1ChangeBounds(nil);
|
Splitter1ChangeBounds(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TreMainForm.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Assigned(Res) then Res.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TreMainForm.HeaderControl1SectionResize(
|
procedure TreMainForm.HeaderControl1SectionResize(
|
||||||
HeaderControl: TCustomHeaderControl; Section: THeaderSection);
|
HeaderControl: TCustomHeaderControl; Section: THeaderSection);
|
||||||
begin
|
begin
|
||||||
@ -200,7 +206,7 @@ begin
|
|||||||
|
|
||||||
TreeView1.Items.Clear;
|
TreeView1.Items.Clear;
|
||||||
if Assigned(Res) then
|
if Assigned(Res) then
|
||||||
Res.Free;
|
FreeAndNil(Res);
|
||||||
|
|
||||||
if not Assigned(Reader) then exit;
|
if not Assigned(Reader) then exit;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user