From 2e89f29fc806a0d130164a1ca136b7927bfb6084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20S=C3=B8holm?= Date: Sun, 2 May 2021 16:40:50 +0200 Subject: [PATCH] Fix crash in link to destroyed agents (#1827) 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; } } }