I have next problem with ODAC 9.2.5. The problem is with code which looks like that:
Code: Select all
OraSession1.Connect;
FOraSQL := TOraSQL.Create(Self);
FOraSQL.SQL.Text := 'select * from v$session where sid = :sid';
FOraSQL.Params[0].DataType := TFieldType(107); // Number
FOraSQL.Prepare;
FOraSQL.Session := OraSession2;
FOraSQL.Free; // <--- Access Violation here
Code: Select all
destructor TOraNumber.Destroy;
begin
Marshal.FreeHGlobal(FIndicator);
if FHandleType <> htShared then //To support SetOCINumberPtr assignation
Marshal.FreeHGlobal(phOCINumber);
if FHandleType <> htLocal then begin
{$IFNDEF AUTOREFCOUNT}
FEnvironment.ReleaseRef; // <-- Exactly here is raised exception
Code: Select all
if FEnvironment <> AEnvironment then begin
{$IFNDEF AUTOREFCOUNT}
if FEnvironment <> nil then
FEnvironment.ReleaseRef;
{$ENDIF}
FEnvironment := AEnvironment;
{$IFNDEF AUTOREFCOUNT}
if FEnvironment <> nil then
FEnvironment.AddRef;
{$ENDIF}
end;
Code: Select all
if FEnvironment <> AEnvironment then begin
{$IFNDEF AUTOREFCOUNT}
if FEnvironment <> nil then
FEnvironment.ReleaseRef;
{$ENDIF}
FEnvironment := AEnvironment;
if FEnvironment <> nil then
begin
FHandleType := htNative;
{$IFNDEF AUTOREFCOUNT}
FEnvironment.AddRef;
{$ENDIF}
end
else
FHandleType := htLocal;
end;