When your factory creates new IDisposable objects, the caller should typically dispose of such an object. A suitable template is the following:
using (var instance = Factory.CreateInstance(someArg)) {
If your factory uses some internal pool, then it is still advisable that the caller delete the object, but in this case, as soon as the instance is deleted, it should be returned to the pool. However, this design is much more complicated.
source share