[patch done] fix destroy forTZSQLStrings in latest FPC 2.7

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
alexs
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 10.01.2011, 10:46

[patch done] fix destroy forTZSQLStrings in latest FPC 2.7

Post by alexs »

this patch fix error on destroy any zeos components.
It's fix mistake - use destroyed fields.
You do not have the required permissions to view the files attached to this post.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Commit your free and nil-changes to my private branch. alexs, the FPC-Versioncheck should be done in ZeosLazarus.inc..
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

where string

Code: Select all

if not (Assigned(FParams) and Assigned(FStatements)) then exit;
in commit ?

because
Ошибка:
в файле ZSQLStrings.pas в строке 361
FParams.Clear;
http://freepascal.ru/forum/viewtopic.ph ... 3#postform
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Ism, i need a better documentation.. Where are the lines? For what is the pach? In which file? Can't read the cyrlic Characters of the fpc.ru forum..
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

in first message patch alexs see string

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 := '';
in testing-egonhugeist rev 1034

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;

not found string

Code: Select all

@@ -357,6 +357,8 @@
   end;
 
 begin
+  if not (Assigned(FParams) and Assigned(FStatements)) then exit;
+
   FParams.Clear;
   FStatements.Clear;
   SQL := '';
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Alexs ZSQLStrings.pas Patch done in testing and testing-egonhugeist rev. 1038 Your other thread is solved too...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Locked