clear textures in remove so not needed outside
This commit is contained in:
@@ -77,9 +77,6 @@ impl<'a> PainterCtx<'a> {
|
||||
return;
|
||||
};
|
||||
|
||||
drop(active.textures);
|
||||
self.textures.free();
|
||||
|
||||
self.primitives.set_pos(active.span.start);
|
||||
self.draw_inner(
|
||||
id,
|
||||
@@ -135,8 +132,6 @@ impl<'a> PainterCtx<'a> {
|
||||
let active = self.remove(id).unwrap();
|
||||
old_children = active.children;
|
||||
resize = active.resize;
|
||||
drop(active.textures);
|
||||
self.textures.free();
|
||||
}
|
||||
|
||||
let mut painter = Painter {
|
||||
@@ -181,12 +176,15 @@ impl<'a> PainterCtx<'a> {
|
||||
self.active.add(id, instance, self.widgets);
|
||||
}
|
||||
|
||||
/// NOTE: instance textures are cleared and self.textures freed
|
||||
fn remove(&mut self, id: &Id) -> Option<WidgetInstance> {
|
||||
let inst = self.active.remove(id);
|
||||
if let Some(inst) = &inst {
|
||||
let mut inst = self.active.remove(id);
|
||||
if let Some(inst) = &mut inst {
|
||||
for h in &inst.primitives {
|
||||
self.primitives.free(h);
|
||||
}
|
||||
inst.textures.clear();
|
||||
self.textures.free();
|
||||
}
|
||||
inst
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user