Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type myClass = class(TMyInterfacedObject)
- public
- destructor Destroy; override;
- end;
- destructor myClass.Destroy;
- begin
- do cleanup
- end;
- procedure MyProcedure;
- var IGuard: iInterface;
- begin
- ...
- IGuard := myClass.Create(acquire resources);
- ....
- end; // IGuard is automatically decremented here and myClass destructor is called
Add Comment
Please, Sign In to add comment