feature request for DisposeAndNil (follow-up on 28891)
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
Maybe something like this can be added to the rtl (either system or sysutils):
procedure DisposeAndNil(var p);
var
temp:Pointer;
begin
temp := Pointer(p);
Pointer(P):=nil;
Dispose(temp);
end;
This is like FreeAndNil but for New/Dispose.
I still think the dispose behavior is counter-intuitive. This may help.
Mantis conversion info:
- Mantis ID: 28895
- OS: all
- OS Build: all
- Platform: all
- Version: 3.1.1
- Fixed in version: 3.0.2
- Fixed in revision: 33377 (#92b8bf97)
- Target version: 3.1.1