Retire inactive windows without invoking stopped runtimes
Verify Tessera GUI / verify (push) Failing after 7m31s
Verify Tessera GUI / verify (push) Failing after 7m31s
This commit is contained in:
@@ -407,6 +407,34 @@ impl NativeCallable for Sync {
|
||||
}
|
||||
|
||||
impl MountTable {
|
||||
/// A faulted domain cannot run user onUnmount callbacks. Still detach every
|
||||
/// context and release its owning dictionary through the normal heap barrier.
|
||||
pub fn retire(&mut self, vm: &mut Vm, desktop: ObjectRef) -> Result<(), VmError> {
|
||||
for weak in self.ordered().into_iter().rev() {
|
||||
if let Some(object) = vm.upgrade(weak)? {
|
||||
let result = (|| {
|
||||
let mut mount = vm.payload::<Mount>(object, "Mount")?.clone();
|
||||
mount.mounted = false;
|
||||
mount.layout = None;
|
||||
mount.parent = None;
|
||||
mount.first_child = None;
|
||||
mount.next_sibling = None;
|
||||
vm.replace_payload(object, mount)?;
|
||||
vm.set_attr(object, "mounted", Value::Bool(false))
|
||||
})();
|
||||
vm.release(object)?;
|
||||
result?;
|
||||
}
|
||||
}
|
||||
let dictionary = vm.new_dict()?;
|
||||
let result = vm.set_attr(desktop, "mounts", Value::Object(dictionary));
|
||||
vm.release(dictionary)?;
|
||||
result?;
|
||||
self.active.clear();
|
||||
self.order.clear();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ordered(&self) -> Vec<WeakObjectRef> {
|
||||
self.order
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user