mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:09:09 +02:00
* fix for mantis #18149, memoryleaks as result from change of stmtprepare to ..stmtprepare2
git-svn-id: trunk@19251 -
This commit is contained in:
parent
604f9ba4b8
commit
79f54fb31a
@ -1,4 +1,4 @@
|
|||||||
unit OracleConnection;
|
unit oracleconnection;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
@ -276,7 +276,6 @@ var tel : integer;
|
|||||||
begin
|
begin
|
||||||
with cursor as TOracleCursor do
|
with cursor as TOracleCursor do
|
||||||
begin
|
begin
|
||||||
OciHandleAlloc(FOciEnvironment,FOciStmt,OCI_HTYPE_STMT,0,FUserMem);
|
|
||||||
if OCIStmtPrepare2(TOracleTrans(ATransaction.Handle).FOciSvcCtx,FOciStmt,FOciError,@buf[1],length(buf),nil,0,OCI_NTV_SYNTAX,OCI_DEFAULT) = OCI_ERROR then
|
if OCIStmtPrepare2(TOracleTrans(ATransaction.Handle).FOciSvcCtx,FOciStmt,FOciError,@buf[1],length(buf),nil,0,OCI_NTV_SYNTAX,OCI_DEFAULT) = OCI_ERROR then
|
||||||
HandleError;
|
HandleError;
|
||||||
if assigned(AParams) then
|
if assigned(AParams) then
|
||||||
@ -354,7 +353,8 @@ end;
|
|||||||
|
|
||||||
procedure TOracleConnection.UnPrepareStatement(cursor: TSQLCursor);
|
procedure TOracleConnection.UnPrepareStatement(cursor: TSQLCursor);
|
||||||
begin
|
begin
|
||||||
OCIHandleFree(TOracleCursor(cursor).FOciStmt,OCI_HTYPE_STMT);
|
if OCIStmtRelease(TOracleCursor(cursor).FOciStmt,FOciError,nil,0,OCI_DEFAULT)<> OCI_SUCCESS then
|
||||||
|
HandleError();
|
||||||
cursor.FPrepared:=False;
|
cursor.FPrepared:=False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user