Closed torkleyy closed 5 years ago
@torkleyy curious what is the difference between this and drop?
It has access to World
, which is required for access to rendy::Factory
in this case.
@torkleyy that makes sense, I would imagine in that case a fn dispose(&mut self, world: &mut World)
might make sense here.
Yeah, I think that makes sense.
Now, how do we make sure it gets called?
One option would be to set a flag when it gets called, and check it is set in Dispatcher::drop
.
Requested by @Frizi.
System::dispose
would be called byDispatcher::dispose
and can be used to clean up externally allocated resources.Unresolved
fn dispose(&self, world: &World)
/fn dispose(&self, world: &mut World)
/fn dispose(&mut self, world: &World)
/fn dispose(&mut self, world: &mut World)