From e226d0cda60dfa23267674cc7f5eb231e1329aea Mon Sep 17 00:00:00 2001 From: Abdelrahman Ashraf Date: Wed, 11 Dec 2024 23:15:30 +0800 Subject: [PATCH] Update dotlottie-rs/src/lottie_renderer/thorvg.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: DragoČ™ Tiselice --- dotlottie-rs/src/lottie_renderer/thorvg.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dotlottie-rs/src/lottie_renderer/thorvg.rs b/dotlottie-rs/src/lottie_renderer/thorvg.rs index fca85977..92e44b58 100644 --- a/dotlottie-rs/src/lottie_renderer/thorvg.rs +++ b/dotlottie-rs/src/lottie_renderer/thorvg.rs @@ -173,11 +173,7 @@ impl Drop for TvgRenderer { tvg::tvg_canvas_destroy(self.raw_canvas); } - if *count == 0 { - unreachable!(); - } - - *count -= 1; + *count = count.checked_sub(1).unwrap(); if *count == 0 { unsafe { tvg::tvg_engine_term(self.engine_method) };