euv_engine/asset/type.rs
1use super::*;
2
3/// A reference-counted, shared-mutable list of asset load callbacks.
4///
5/// Stores `Closure` objects to prevent them from being dropped prematurely,
6/// avoiding memory leaks when registering `onload`/`onerror` handlers.
7///
8/// Held behind `EngineCell` (an `UnsafeCell`-backed `Sync` newtype)
9/// rather than `RefCell` so the storage matches the rest of the
10/// engine's `static mut` convention. Access via [`EngineCell::get_mut`]
11/// to obtain the underlying `Vec` for push / clear operations.
12pub type AssetClosures = Rc<EngineCell<Vec<Closure<dyn FnMut()>>>>;