From c6005079e12c4e55b9042623291d6aec610a12e1 Mon Sep 17 00:00:00 2001 From: Maccesch Date: Fri, 26 Jul 2024 10:18:09 +0100 Subject: [PATCH] fixed signal out of scope issue with use_raf_fn. Fixes #135 --- CHANGELOG.md | 1 + src/use_raf_fn.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bf1185..c1c06a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed auto-reconnect in `use_websocket` - Fixed typo in compiler error messages in `use_cookie` (thanks to @SleeplessOne1917). +- Fixed potential signal out of scope issue with `use_raf_fn` ## [0.10.10] - 2024-05-10 diff --git a/src/use_raf_fn.rs b/src/use_raf_fn.rs index a5010db..d390cd1 100644 --- a/src/use_raf_fn.rs +++ b/src/use_raf_fn.rs @@ -89,7 +89,7 @@ pub fn use_raf_fn_with_options( let previous_frame_timestamp = Cell::new(0.0_f64); move |timestamp: f64| { - if !is_active.get_untracked() { + if !is_active.try_get_untracked().unwrap_or_default() { return; }