Skip to content

Commit

Permalink
Fix crash in link to destroyed agents (#1827)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kristoff3r authored May 2, 2021
1 parent c7bc8e0 commit 2e89f29
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/yew/src/agent/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ where
.take()
.expect("trying to destroy not existent agent");
agent.destroy();
state.destroyed = true;
}
}
}
Expand Down

0 comments on commit 2e89f29

Please sign in to comment.