Handing out Disposable objects

Vince asks a question about handing out Disposable objects:

Lets say I have a class that has a method that returns a new DataSet:

public DataSet GetData();

I'll have no control over the DataSet being disposed.  As an object creator
is it my concern that the object I created eventually gets disposed or
should I not care and trust that the consumer of this method will do the
right thing?

A good thread to read.  I especially liked Frans’ response:

When you buy a happy meal at McDonalds, you're responsible for disposing the left overs and the rest of the trash, not Donald (sic) McD. 

Published Thursday, August 03, 2006 9:19 PM by PSteele

Comments

# Ian Griffiths: "You can't just leave everything to the GC"

In another follow-up to the thread I mentioned in my previous post, Ian Griffiths talks about some common

Monday, August 07, 2006 9:28 AM by Patrick Steele's .NET Blog