Closed Saalvage closed 8 months ago
I'm on the fence about this a little bit, but it's a small change with nonzero use and effectively zero possible downside other than a tiny amount of refactoring effort later.
It'd be nice to have the more general version, but off the top of my head, it'd probably get blocked by subtle variations in the dispose signature (e.g. different parameters) and would give a false sense of universality, so a more focused option for a dedicated use case seems reasonable.
Thanks!
Allows for properly disposing of a shape, given only an
IShape
without having to do various type checks.An alternative approach would be introducing something like
IBufferPoolDisposable
and tagging everything in the library that supports disposing via a buffer pool. Potential use cases for that would be tracking everything that needs disposing for aBufferPool
instance or something along those lines? If that seems like a more appropriate approach I can adjust the PR, but I personally feel like this is probably sufficient for now.