Added GraphModuleManager::ReleaseModule(GraphModule *)

This commit is contained in:
hyzboy 2024-11-05 23:01:45 +08:00
parent f1f562c709
commit f6cc1ee619
2 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,8 @@ public:
template<typename T> template<typename T>
T *GetModule(bool create=false){return (T *)GetModule(T::GetModuleName(),create);} ///<获取指定类型的模块 T *GetModule(bool create=false){return (T *)GetModule(T::GetModuleName(),create);} ///<获取指定类型的模块
void ReleaseModule(GraphModule *); ///<释放指定模块
const bool IsLoaded(const AnsiIDName &name){return graph_module_map.ContainsKey(name);} ///<是否已经加载了指定类型的模块 const bool IsLoaded(const AnsiIDName &name){return graph_module_map.ContainsKey(name);} ///<是否已经加载了指定类型的模块
template<typename T> template<typename T>

View File

@ -97,6 +97,15 @@ GraphModuleManager::~GraphModuleManager()
} }
} }
void GraphModuleManager::ReleaseModule(GraphModule *gm)
{
if(!gm)
return;
graph_module_map.DeleteByValue(gm);
delete gm;
}
void GraphModuleManager::OnResize(const VkExtent2D &extent) void GraphModuleManager::OnResize(const VkExtent2D &extent)
{ {
if(graph_module_map.IsEmpty()) if(graph_module_map.IsEmpty())