forked from Orchid/orchid
Correctly halts
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user