[patch done] fix destroy forTZSQLStrings in latest FPC 2.7
Posted: 23.02.2012, 19:25
this patch fix error on destroy any zeos components.
It's fix mistake - use destroyed fields.
It's fix mistake - use destroyed fields.
This is the official forum of ZeosLib providing support to all ZeosLib users.
https://zeoslib.sourceforge.io/
Code: Select all
if not (Assigned(FParams) and Assigned(FStatements)) then exit;
http://freepascal.ru/forum/viewtopic.ph ... 3#postformОшибка:
в файле ZSQLStrings.pas в строке 361
FParams.Clear;
Code: Select all
+ if not (Assigned(FParams) and Assigned(FStatements)) then exit;
Code: Select all
Index: src/component/ZSqlStrings.pas
===================================================================
--- src/component/ZSqlStrings.pas (revision 887)
+++ src/component/ZSqlStrings.pas (working copy)
@@ -197,8 +197,8 @@
}
destructor TZSQLStrings.Destroy;
begin
- FParams.Free;
- FStatements.Free;
+ FreeAndNil(FParams);
+ FreeAndNil(FStatements);
inherited Destroy;
end;
@@ -357,6 +357,8 @@
end;
begin
+ if not (Assigned(FParams) and Assigned(FStatements)) then exit;
+
FParams.Clear;
FStatements.Clear;
SQL := '';
Code: Select all
Index: ZSqlStrings.pas
===================================================================
--- ZSqlStrings.pas (revision 1033)
+++ ZSqlStrings.pas (revision 1034)
@@ -198,8 +198,8 @@
}
destructor TZSQLStrings.Destroy;
begin
- FParams.Free;
- FStatements.Free;
+ FreeAndNil(FParams);//.Free;
+ FreeAndNil(FStatements);//.Free;
inherited Destroy;
end;
Code: Select all
@@ -357,6 +357,8 @@
end;
begin
+ if not (Assigned(FParams) and Assigned(FStatements)) then exit;
+
FParams.Clear;
FStatements.Clear;
SQL := '';