Correctly halts

This commit is contained in:
2025-09-16 22:54:14 +02:00
parent ee45dbd28e
commit 7971a2b4eb
29 changed files with 381 additions and 195 deletions

View File

@@ -25,11 +25,11 @@ impl AtomData {
#[must_use]
fn api(self) -> api::Atom {
let (owner, drop, data, _display) = self.destructure();
api::Atom { data, drop, owner: owner.id() }
api::Atom { data: api::AtomData(data), drop, owner: owner.id() }
}
#[must_use]
fn api_ref(&self) -> api::Atom {
api::Atom { data: self.data.clone(), drop: self.drop, owner: self.owner.id() }
api::Atom { data: api::AtomData(self.data.clone()), drop: self.drop, owner: self.owner.id() }
}
}
impl Drop for AtomData {
@@ -97,7 +97,11 @@ impl AtomRepr for AtomHand {
async fn from_api(atom: &api::Atom, _: Pos, ctx: &mut Self::Ctx) -> Self {
let api::Atom { data, drop, owner } = atom.clone();
let sys = ctx.system_inst(owner).await.expect("Dropped system created atom");
if let Some(id) = drop { sys.new_atom(data, id).await } else { AtomHand::new(data, sys, drop) }
if let Some(id) = drop {
sys.new_atom(data.0, id).await
} else {
AtomHand::new(data.0, sys, drop)
}
}
async fn to_api(&self) -> orchid_api::Atom { self.api_ref() }
}