Skip to content

Commit

Permalink
WIP - Working on resolving memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
FiftyTifty committed Feb 5, 2020
1 parent e8faba2 commit 9c02ff0
Show file tree
Hide file tree
Showing 69 changed files with 6,529 additions and 4,793 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ uses
Form_ConanExiles_ItemStatModification_Entry in '..\Conan Exiles - Delphi Forms\Form_ConanExiles_ItemStatModification_Entry.pas' {Form_ConanExiles_ItemStatModification_Entry: TFrame},
fytyConanExilesTypes in '..\Conan Exiles - API\fytyConanExilesTypes.pas',
fytyConanExilesTypesFunctions in '..\Conan Exiles - API\fytyConanExilesTypesFunctions.pas',
djson in '..\_Library - delphi-json-master\djson.pas';
djson in '..\_Library - delphi-json-master\djson.pas',
Unit2 in 'Unit2.pas' {formWindowSelectIncludeExclude};

{$R *.res}

begin
ReportMemoryLeaksOnShutdown := True;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TformWindow, formWindow);
Application.CreateForm(TformWindowSelectIncludeExclude, formWindowSelectIncludeExclude);
Application.Run;
end.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@
<DCCReference Include="..\Conan Exiles - API\fytyConanExilesTypes.pas"/>
<DCCReference Include="..\Conan Exiles - API\fytyConanExilesTypesFunctions.pas"/>
<DCCReference Include="..\_Library - delphi-json-master\djson.pas"/>
<DCCReference Include="Unit2.pas">
<Form>formWindowSelectIncludeExclude</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
Expand Down Expand Up @@ -164,6 +168,18 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win64\Debug\ConanExilesItemStatModificationEditor.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win64">
<RemoteName>ConanExilesItemStatModificationEditor.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win64\Debug\ConanExilesItemStatModificationEditor.rsm" Configuration="Debug" Class="DebugSymbols">
<Platform Name="Win64">
<RemoteName>ConanExilesItemStatModificationEditor.rsm</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<BorlandProject>
<Transactions>
<Transaction>2019/10/28 21:47:31.000.918,=H:\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
<Transaction>2019/10/28 21:48:00.000.693,H:\Documents\Embarcadero\Studio\Projects\Unit1.pas=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\Unit1.pas</Transaction>
<Transaction>2019/10/28 21:48:00.000.693,H:\Documents\Embarcadero\Studio\Projects\Unit1.dfm=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\Unit1.dfm</Transaction>
<Transaction>2019/10/28 21:48:10.000.887,H:\Documents\Embarcadero\Studio\Projects\Project1.dproj=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\ConanExilesItemStatModificationEditor.dproj</Transaction>
<Transaction>2019/10/28 21:48:00.000.693,H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\Unit1.pas=H:\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
<Transaction>2019/10/28 21:48:00.000.693,H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\Unit1.dfm=H:\Documents\Embarcadero\Studio\Projects\Unit1.dfm</Transaction>
<Transaction>2019/10/28 21:48:10.000.887,H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\ConanExilesItemStatModificationEditor.dproj=H:\Documents\Embarcadero\Studio\Projects\Project1.dproj</Transaction>
<Transaction>2019/10/28 21:52:39.000.843,=H:\Documents\Embarcadero\Studio\Projects\_Library - delphi-json-master\djson.pas</Transaction>
<Transaction>2019/10/28 22:54:49.000.623,=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\Unit2.pas</Transaction>
<Transaction>2019/10/29 00:48:48.000.800,=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - ItemStatModification Editor\Form_ConanExiles_ItemStatModification_Entry.pas</Transaction>
Expand All @@ -17,6 +17,7 @@
<Transaction>2019/11/01 21:11:34.000.119,=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles - API\fytyConanExilesTypesFunctions.pas</Transaction>
<Transaction>2020/01/24 00:36:20.000.238,H:\Documents\Embarcadero\Studio\Projects\Conan Exiles\_Library - delphi-json-master\djson.pas=</Transaction>
<Transaction>2020/01/24 00:36:33.000.385,=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles\_Library - delphi-json-master\djson.pas</Transaction>
<Transaction>2020/02/04 04:43:04.000.022,=H:\Documents\Embarcadero\Studio\Projects\Conan Exiles\Conan Exiles - ItemStatModification Editor\Unit2.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\Conan Exiles"/>
Expand All @@ -30,5 +31,8 @@
<File Path="..\_Library - delphi-json-master\djson.pas"/>
<File Path="Unit1.pas"/>
<File Path="Unit1.dfm"/>
<File Path="Unit2.pas"/>
<File Path="Unit2.dfm"/>
</ProjectSortOrder>
<BT_BuildType>Debug</BT_BuildType>
</BorlandProject>
Binary file not shown.
16 changes: 16 additions & 0 deletions Conan Exiles - ItemStatModification Editor/Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ object formWindow: TformWindow
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
Expand Down Expand Up @@ -108,8 +109,12 @@ object formWindow: TformWindow
Text = 'Thrall Crafting Speed'
end
inherited formValue: TEdit
Left = 151
Top = 360
NumbersOnly = False
OnKeyPress = CEValueOnKeyPress
ExplicitLeft = 151
ExplicitTop = 360
end
inherited formIsFloat: TCheckBox
OnClick = IsFloatClick
Expand Down Expand Up @@ -317,4 +322,15 @@ object formWindow: TformWindow
TabOrder = 6
OnClick = buttonApplyClick
end
object buttonFilter: TButton
Left = 144
Top = 473
Width = 75
Height = 25
Caption = 'Filter...'
Enabled = False
TabOrder = 7
Visible = False
OnClick = buttonFilterClick
end
end
25 changes: 23 additions & 2 deletions Conan Exiles - ItemStatModification Editor/Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ interface
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, System.JSON, rest.JSON,
CommCtrl,
djson, Vcl.ComCtrls, Vcl.StdCtrls, fytyConanExilesTypes, fytyConanExilesTypesFunctions,
Form_ConanExiles_ItemStatModification_Entry;
Form_ConanExiles_ItemStatModification_Entry,
Unit2;

//Unit2 Is the filter window

type
TformWindow = class(TForm)
Expand All @@ -27,6 +30,7 @@ TformWindow = class(TForm)
formSource: TMemo;
formResult: TMemo;
buttonApply: TButton;
buttonFilter: TButton;
procedure buttonLoadClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure CEValueOnKeyPress(
Expand All @@ -38,6 +42,7 @@ TformWindow = class(TForm)
Sender: TObject);
procedure buttonApplyClick(Sender: TObject);
procedure buttonSaveClick(Sender: TObject);
procedure buttonFilterClick(Sender: TObject);
private
{ Private declarations }
public
Expand Down Expand Up @@ -141,6 +146,16 @@ procedure TformWindow.buttonApplyClick(Sender: TObject);

end;

procedure TformWindow.buttonFilterClick(Sender: TObject);
begin

if formWindowSelectIncludeExclude.Showing then
formWindowSelectIncludeExclude.Hide
else
formWindowSelectIncludeExclude.Show;

end;

procedure TformWindow.buttonLoadClick(Sender: TObject);
var
iCounter: integer;
Expand Down Expand Up @@ -201,8 +216,12 @@ procedure TformWindow.buttonLoadClick(Sender: TObject);
//else
//ShowMessage(treeEntry.text);

Unit2.formWindowSelectIncludeExclude.formListFilter.Items.Append(treeEntry.Text);

Inc(iCounter);

buttonFilter.Enabled := true;
buttonFilter.Visible := true;
buttonSave.Enabled := true;
buttonSave.Visible := true;

Expand All @@ -219,8 +238,8 @@ procedure TformWindow.buttonSaveClick(Sender: TObject);
arrayjsonOutput: TJSONArray;
begin

arrayjsonOutput := TJSONArray.Create;
try
arrayjsonOutput := TJSONArray.Create;

for ceismToConvert in listCEItemStatModification do begin

Expand All @@ -237,6 +256,8 @@ procedure TformWindow.buttonSaveClick(Sender: TObject);
//jsonCEISMConverted.Free;
finally
//Memory leak! Freeing jsonCEISMConverted throws exception for some reason
//for jsonCEISMConverted in arrayjsonOutput do
// jsonCEISMConverted.Free;
arrayjsonOutput.Free;
ShowMessage('Wrote JSON to formResult!');
end;
Expand Down
86 changes: 86 additions & 0 deletions Conan Exiles - ItemStatModification Editor/Unit2.dfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
object formWindowSelectIncludeExclude: TformWindowSelectIncludeExclude
Left = 0
Top = 0
Caption = 'Include/Exclude In Export'
ClientHeight = 968
ClientWidth = 664
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
PixelsPerInch = 96
TextHeight = 13
object formGroupFilter: TGroupBox
Left = 8
Top = 8
Width = 225
Height = 129
TabOrder = 0
object formDoFilter: TCheckBox
Left = 16
Top = 16
Width = 193
Height = 17
Caption = 'Not Currently Filtering Output'
TabOrder = 0
end
object Memo1: TMemo
Left = 16
Top = 39
Width = 193
Height = 74
Enabled = False
Lines.Strings = (
'When ticked, the JSON output will be '
'filtered accordingly.'
''
'When unticked, the JSON will output '
'everything as it normally would.')
ParentColor = True
TabOrder = 1
end
end
object GroupBox1: TGroupBox
Left = 8
Top = 167
Width = 225
Height = 146
TabOrder = 1
object formDoIncludeExclude: TCheckBox
Left = 16
Top = 16
Width = 193
Height = 17
Caption = 'Only Including Ticked ItemStatMods'
TabOrder = 0
end
object Memo2: TMemo
Left = 16
Top = 39
Width = 193
Height = 90
Enabled = False
Lines.Strings = (
'When ticked, ticked items in the list '
'will be excluded from the JSON '
'output.'
''
'When unticked, only ticked items will '
'be in the JSON output.')
ParentColor = True
TabOrder = 1
end
end
object formListFilter: TCheckListBox
Left = 248
Top = 8
Width = 408
Height = 952
ItemHeight = 13
TabOrder = 2
end
end
31 changes: 31 additions & 0 deletions Conan Exiles - ItemStatModification Editor/Unit2.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
unit Unit2;

interface

uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.CheckLst;

type
TformWindowSelectIncludeExclude = class(TForm)
formDoFilter: TCheckBox;
formGroupFilter: TGroupBox;
Memo1: TMemo;
GroupBox1: TGroupBox;
formDoIncludeExclude: TCheckBox;
Memo2: TMemo;
formListFilter: TCheckListBox;
private
{ Private declarations }
public
{ Public declarations }
end;

var
formWindowSelectIncludeExclude: TformWindowSelectIncludeExclude;

implementation

{$R *.dfm}

end.
Binary file not shown.
Binary file not shown.
Binary file modified Conan Exiles - ItemStatModification Editor/Win64/Debug/Unit1.dcu
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
program ConanExilesItemStatModificationEditor;

uses
Vcl.Forms,
Unit1 in 'Unit1.pas' {formWindow},
Form_ConanExiles_ItemStatModification_Entry in '..\Conan Exiles - Delphi Forms\Form_ConanExiles_ItemStatModification_Entry.pas' {Form_ConanExiles_ItemStatModification_Entry: TFrame},
fytyConanExilesTypes in '..\Conan Exiles - API\fytyConanExilesTypes.pas',
fytyConanExilesTypesFunctions in '..\Conan Exiles - API\fytyConanExilesTypesFunctions.pas',
djson in '..\_Library - delphi-json-master\djson.pas';

{$R *.res}

begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TformWindow, formWindow);
Application.Run;
end.
Loading

0 comments on commit 9c02ff0

Please sign in to comment.