amethyst / shred

Shared resource dispatcher
Apache License 2.0
237 stars 66 forks source link

Add 'remove' method to Resources. #107

Closed thorjelly closed 5 years ago

thorjelly commented 5 years ago

It seems to be desirable to take ownership again of a resource, without needing to wrap that resource in an Option, by removing it from Resources. For example, in my case, gfx::Device requires to be passed ownership of some things to destroy them, such as buffers, which I am using inside of a Resource. It is possible to wrap these in Option and take() them, but because during dispatch these should never be taken and never be None, it seems, though a very minor inconvenience, an unfortunate solution.

torkleyy commented 5 years ago

Thanks for the issue!

The reasons I remember for not doing this initially:

I'm inclined to add such a method, but it needs some more thinking.