Commit 7c0f2fe8 by Mac Stephens

fixed memory issues

parent 03dea1fa
......@@ -133,7 +133,7 @@ begin
colorList := TJSONArray(colorObject.GetValue('items'));
result := IntToStr(colorList.Count);
finally
colorObject.Free; // Free TJSONObject to avoid leaks
colorObject.Free;
end;
end;
end;
......@@ -161,7 +161,7 @@ begin
frxOrders.Export(frxPDFExport1);
//frxOrders.ShowPreparedReport;
finally
frxOrders.Clear; // Clear the report to avoid memory bloat
frxOrders.Clear; // Clears the report to avoid memory bloat
end;
Logger.Log(5, 'PDF saved to: ' + ReportFileName);
......
......@@ -7,7 +7,6 @@ uses
procedure LoadDatabaseSettings( uc: TUniConnection; iniFilename: string );
procedure DoQuery( uq: TUniQuery; sql: string );
function CalculateAge( const dob, dt: TDateTime ): Integer;
implementation
......@@ -39,33 +38,5 @@ begin
uq.Open;
end;
function CalculateAge( const dob, dt: TDateTime): Integer;
var
age: Integer;
y1, m1, d1, y2, m2, d2: Word;
begin
Result := 0;
if dt < dob then
Exit;
DecodeDate( dob, y1, m1, d1);
DecodeDate( dt, y2, m2, d2);
age := y2 - y1;
// Feb 29
//if ( (m1=2) and (d1=29) ) and ( not IsLeapYear(y2) ) then
// d1 := 28;
if (m1 = 2) and (d1 = 29) and (not (IsLeapYear (y2))) then
begin
m1 := 3;
d1 := 1;
end;
if (m2 < m1) or ((m2 = m1) and (d2 < d1)) then
Dec(age);
Result := age
end;
end.
[Settings]
MemoLogLevel=4
FileLogLevel=5
LogFileNum=71
LogFileNum=90
webClientVersion=1.0.0
[Database]
Server=192.168.159.132
--Server=192.168.102.130
--Server=192.168.159.132
Server=192.168.102.130
--Server=192.168.75.133
--Database=
--Username=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment