Should I call .Dispose() after returning an object that implements IDisposable?
myDisposableObject Gimme() {
//Code
return disposableResult;
disposableResult.Dispose();
}
In other words, is the object I return a copy, or is it the object itself? Thanks :)
It's the object itself. Don't call Dispose here, even if you reverse the order so that it gets called.