mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 22:30:30 +02:00
* Added DisposeAndNil (bug ID 28895)
git-svn-id: trunk@33377 -
This commit is contained in:
parent
6e56f5c191
commit
92b8bf97c0
@ -321,6 +321,7 @@ Type
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
procedure FreeAndNil(var obj);
|
procedure FreeAndNil(var obj);
|
||||||
|
procedure DisposeAndNil(var p);
|
||||||
|
|
||||||
{ interface handling }
|
{ interface handling }
|
||||||
{$i intfh.inc}
|
{$i intfh.inc}
|
||||||
|
@ -162,7 +162,16 @@ end;
|
|||||||
temp.free;
|
temp.free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure DisposeAndNil(var p);
|
||||||
|
|
||||||
|
var
|
||||||
|
temp:Pointer;
|
||||||
|
begin
|
||||||
|
temp := Pointer(p);
|
||||||
|
Pointer(P):=nil;
|
||||||
|
FreeMem(temp);
|
||||||
|
end;
|
||||||
|
|
||||||
{ Interfaces support }
|
{ Interfaces support }
|
||||||
{$i sysuintf.inc}
|
{$i sysuintf.inc}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user