I am fairly new to learning C# (from Java & C++ background) and I have a question about manual gargabe disposal: is it even possible to manually destroy an object in C#? I know about the IDisposable
interface, but suppose I'm dealing with a class I didn't write and it doesn't implement it? It wouldn't have a .Dispose()
method, so that and using { }
is out, and .Finalize
is always either protected
or private
so that's not an option either.
(I am just trying to learn what is possible in C# in this case. I suppose if all else fails I could inherit the hypothetical ImNotDisposable
class so that it does implement IDisposable.)