mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 20:09:18 +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}
|
||||
|
||||
procedure FreeAndNil(var obj);
|
||||
procedure DisposeAndNil(var p);
|
||||
|
||||
{ interface handling }
|
||||
{$i intfh.inc}
|
||||
|
@ -162,7 +162,16 @@ end;
|
||||
temp.free;
|
||||
end;
|
||||
|
||||
|
||||
procedure DisposeAndNil(var p);
|
||||
|
||||
var
|
||||
temp:Pointer;
|
||||
begin
|
||||
temp := Pointer(p);
|
||||
Pointer(P):=nil;
|
||||
FreeMem(temp);
|
||||
end;
|
||||
|
||||
{ Interfaces support }
|
||||
{$i sysuintf.inc}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user