fix(audio+model): drop sk asset to the destroy queue

This commit is contained in:
Nova
2024-02-04 20:22:15 -05:00
parent eec38dd60f
commit 36dacb3322
2 changed files with 13 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
use super::{MaterialParameter, ModelAspect, ModelPartAspect, Node};
use crate::core::client::Client;
use crate::core::destroy_queue;
use crate::core::node_collections::LifeLinkedNodeMap;
use crate::core::registry::Registry;
use crate::core::resource::get_resource_file;
@@ -332,6 +333,9 @@ impl Model {
impl ModelAspect for Model {}
impl Drop for Model {
fn drop(&mut self) {
if let Some(sk_model) = self.sk_model.take() {
destroy_queue::add(sk_model);
}
MODEL_REGISTRY.remove(self);
}
}