Patch for TZPostgreSQLConnection

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
Shagrat3
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 28.07.2009, 16:02
Contact:

Patch for TZPostgreSQLConnection

Post by Shagrat3 »

Exception on destroy program

Haw it's make
Create new project
Append TZConnecttion, TZSQLMonitor
On Create
Make connection to server
When halt(0)

On Destroy
Make query ZConnection.ExecuteDirect

Patch:

Code: Select all

Index: ZDbcPostgreSql.pas
===================================================================
--- ZDbcPostgreSql.pas	(revision 1089)
+++ ZDbcPostgreSql.pas	(working copy)
@@ -746,13 +746,14 @@
 var
   LogMessage: string;
 begin
-  if not Closed then
-  begin
+  if not Closed then begin
     FPlainDriver.Finish(FHandle);
     FHandle := nil;
     LogMessage := Format('DISCONNECT FROM "%s"', [Database]);
-    DriverManager.LogMessage(lcDisconnect, FPlainDriver.GetProtocol, LogMessage);
+    if Assigned(DriverManager) then
+      DriverManager.LogMessage(lcDisconnect, FPlainDriver.GetProtocol, LogMessage);
   end;
+
   inherited Close;
 end;
Tested ON: Win7, Delphi XE2, Postgres 8.4
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Does that mean the DriverManager is destroyed before your connection is freed an nilled? If this is true than we've the same issue on the other connections too. So can you post a example? It makes everything more clear.

Btw. what about you FastLocate-thread. Waiting for reply...

best regards
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