Own asynchronous timer tasks in the managed object lifecycle
Verify Tessera GUI / verify (push) Failing after 7m26s
Verify Tessera GUI / verify (push) Failing after 7m26s
This commit is contained in:
@@ -21,6 +21,7 @@ pub struct Mount {
|
||||
pub scroll_offset: [f32; 2],
|
||||
pub version: u64,
|
||||
pub mounted: bool,
|
||||
pub tasks: Option<ObjectRef>,
|
||||
// Private derived scratch, installed before the read-only layout call and
|
||||
// cleared by geometry commit. It contains no managed references or roots.
|
||||
pub layout: Option<Arc<Mutex<crate::layout::Context>>>,
|
||||
@@ -41,6 +42,9 @@ impl ObjectPayload for Mount {
|
||||
}
|
||||
fn trace(&self, visit: &mut dyn FnMut(ObjectRef)) {
|
||||
visit(self.block);
|
||||
if let Some(tasks) = self.tasks {
|
||||
visit(tasks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,6 +324,7 @@ impl NativeCallable for Sync {
|
||||
scroll_offset: [0.0, 0.0],
|
||||
version: self.frame.layout_version,
|
||||
mounted: true,
|
||||
tasks: None,
|
||||
layout: None,
|
||||
})?;
|
||||
crate::ui_bridge::attach_desktop_type(cx, object, "Mount", self.desktop)?;
|
||||
@@ -361,6 +366,7 @@ impl NativeCallable for Sync {
|
||||
id.map(|id| cx.store().downgrade(objects[&id])).transpose()
|
||||
};
|
||||
let mount = Mount {
|
||||
tasks: cx.store().payload::<Mount>(object, "Mount")?.tasks,
|
||||
block: blocks[&geometry.block_id],
|
||||
page,
|
||||
parent: link(geometry.parent)?,
|
||||
@@ -418,6 +424,7 @@ impl NativeCallable for Sync {
|
||||
&& objects.get(id) != Some(&object)
|
||||
{
|
||||
let mut mount = cx.store().payload::<Mount>(object, "Mount")?.clone();
|
||||
crate::tasks::cancel_owner(cx, object)?;
|
||||
mount.mounted = false;
|
||||
mount.layout = None;
|
||||
mount.parent = None;
|
||||
|
||||
Reference in New Issue
Block a user