I found a bug in ODAC. I'm using Delphi XE4 and ODAC 9.3.10. I wrote small apps which could demonstrate problem:
Dfm file:
Code: Select all
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 242
ClientWidth = 527
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object orsn1: TOraSession
Username = 'system'
Server = 'xe'
ConnectDialog = cnctdlg1
Left = 256
Top = 128
end
object cnctdlg1: TConnectDialog
Caption = 'Rejestracja'
ConnectButton = 'Ok'
CancelButton = 'Anuluj'
Server.Caption = 'Opis hosta'
Server.Visible = True
Server.Order = 1
UserName.Caption = 'U'#380'ytkownik'
UserName.Visible = True
UserName.Order = 2
Password.Caption = 'Has'#322'o'
Password.Visible = True
Password.Order = 3
Home.Caption = 'Home Name'
Home.Visible = False
Home.Order = 0
Direct.Caption = 'Direct'
Direct.Visible = False
Direct.Order = 6
Schema.Caption = 'Schema'
Schema.Visible = False
Schema.Order = 4
Role.Caption = 'Connect Mode'
Role.Visible = False
Role.Order = 5
LabelSet = lsCustom
Left = 160
Top = 120
end
object q1: TOraQuery
Session = orsn1
SQL.Strings = (
'select * from dual')
Left = 344
Top = 136
end
end
Code: Select all
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, DBAccess, OdacVcl, OraCall, Data.DB, Ora, MemDS;
type
TForm1 = class(TForm)
orsn1: TOraSession;
cnctdlg1: TConnectDialog;
q1: TOraQuery;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
list: TStringList;
begin
orsn1.Connect;
list := TStringList.Create;
q1.GetFieldNames(list);
Caption := list.Text;
list.Free;
end;
end.
Code: Select all
program Project1;
uses
FastMM4,
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
best regards--------------------------------2015/4/2 18:15:43--------------------------------
This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):
1 - 20 bytes: TDAObjectList x 2, UnicodeString x 1
21 - 100 bytes: TOracleHomes x 1, EAccessViolation x 3, TMTSAPI x 1, TCriticalSection x 7, TOracleHome x 1, TOCISvcCtx x 1, UnicodeString x 1, Unknown x 2
101 - 196 bytes: TOCI7API x 1, UnicodeString x 6
789 - 948 bytes: TOCI8API x 1
Note: Memory leak detail is logged to a text file in the same folder as this application. To disable this memory leak check, undefine "EnableMemoryLeakReporting".
Adam Siwoń