7.0.5 Memory leak
Posted: 09.09.2013, 22:09
Hello
If i try this simple project, then memory manager generate memory leak mesage:
I don't know why, but i try break code in finalization part of unit ZDbcMySql
Maybe problem is here: I tried insert breakpoint to method TZAbstractDriver.Destroy but this method was never executed!
If i try this simple project, then memory manager generate memory leak mesage:
Code: Select all
program LeakProj;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, ZDbcIntfs, ZDbcMySql;
var
sConString: string;
LZeos: IZConnection;
begin
ReportMemoryLeaksOnShutdown := True;
sConString := Format('zdbc:%s://%s:%d/%s?UID=%s;PWD=%s', ['mysql-5', '127.0.0.1', 4434, 'aslibex_dunit_zeos', 'root', '']);
LZeos := DriverManager.GetConnection(sConString);
LZeos := nil;
end.
Code: Select all
initialization
MySQLDriver := TZMySQLDriver.Create;
DriverManager.RegisterDriver(MySQLDriver);
finalization
if DriverManager <> nil then
DriverManager.DeregisterDriver(MySQLDriver);
MySQLDriver := nil; //<< In this place MySQLDriver ref count have value 2!
end. //<< In this place MySQLDriver ref count have still value 1! MySQLDriver is never destroyed!