What is the secure way to manage the Object Lifetime from a object in island/windows?
Let’s say I have a class that wraps an external resource.
Now I wan’t an automatic cleanup if this object goes out of scope.
I can write a method and call it, or should I write the classes as IDisposable and
and do something like
Using ctx := new Context(....) do begin
// Use the ctx
end;
This seems to work. Is it the right way? And if I use “Using” the compiler does not flag a error if the class is not a IDisposable, is this correct?