mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 22:28:12 -05:00
= Crash = 1. User quits -> god.stop_app() -> runtime stops 2. Arc<ManagedSeqAnim> drops -> delete_unmanaged_anim() -> animation removed from self.anims 3. miniquad event loop calls draw() one more time 4. draw_call() hits GfxDrawInstruction::Animation(anim_id) -> self.anims.get_mut(&anim_id).unwrap() PANIC! Animation was already deleted in step 2 = Cause = - DrawCall holds Animation(AnimId) - just an ID, not a reference - self.anims: HashMap<AnimId, GfxSeqAnim> stores actual animation data - ManagedSeqAnim::drop() removes animation from self.anims - DrawCalls may still reference deleted animations - Race during shutdown: animations deleted before final draw() = Fix = Change Animation(AnimId) to Animation(ManagedSeqAnimPtr): - Arc keeps ManagedSeqAnim alive as long as DrawCall exists - Drop only fires when all DrawCalls are dropped - Animation stays in self.anims until safe to delete - Uses Rust ownership to prevent bug at compile time