From e425ae48ab0b9a708eea7717dd73d24fa94069bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20S=C3=B8holm?= Date: Wed, 28 Apr 2021 11:37:02 +0200 Subject: [PATCH] Fix crash in link to destroyed agents The destroyed field on the agent state was never set, so the early return in `run` didn't prevent crashes when agents receive messages after they are destroyed. --- packages/yew/src/agent/link.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/yew/src/agent/link.rs b/packages/yew/src/agent/link.rs index 62acc10cdb7..cc365208a80 100644 --- a/packages/yew/src/agent/link.rs +++ b/packages/yew/src/agent/link.rs @@ -207,6 +207,7 @@ where .take() .expect("trying to destroy not existent agent"); agent.destroy(); + state.destroyed = true; } } }