diff --git a/src/runtime2/runtime.rs b/src/runtime2/runtime.rs index 2c68998ea2f78728e3938f6aee435a313405c14c..80865946a82159b688217f614d29ba7a73311f6c 100644 --- a/src/runtime2/runtime.rs +++ b/src/runtime2/runtime.rs @@ -306,12 +306,15 @@ impl RuntimeInner { return CompHandle::new(id, &component.public); } + /// Will remove a component and its memory from the runtime. May only be + /// called if the necessary conditions for destruction have been met. pub(crate) fn destroy_component(&self, key: CompKey) { dbg_code!({ let component = self.get_component(key); debug_assert!(component.exiting); debug_assert_eq!(component.public.num_handles.load(Ordering::Acquire), 0); }); + self.decrement_active_components(); self.components.destroy(key.0); }