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