mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 00:10:32 +00:00
Changed how module properties are passed to lambda executed during hot-reloading as lambdas with mutable captures seems to be not always supported.
This commit is contained in:
parent
c662869820
commit
0c69e6ddfc
@ -133,7 +133,7 @@ void FImGuiModule::ShutdownModule()
|
||||
// In editor store data that we want to move to hot-reloaded module.
|
||||
|
||||
#if WITH_EDITOR
|
||||
TOptional<FImGuiModuleProperties> PropertiesToMove = ImGuiModuleManager->GetProperties();
|
||||
static TOptional<FImGuiModuleProperties> PropertiesToMove = ImGuiModuleManager->GetProperties();
|
||||
#endif
|
||||
|
||||
// Before we shutdown we need to delete managers that will do all the necessary cleanup.
|
||||
@ -153,7 +153,7 @@ void FImGuiModule::ShutdownModule()
|
||||
// deleted. This can cause troubles after hot-reload when code in other modules calls ImGui interface functions
|
||||
// which are statically bound to the obsolete module. To keep ImGui code functional we can redirect context handle
|
||||
// to point to the new module.
|
||||
FModuleManager::Get().OnModulesChanged().AddLambda([this, PropertiesToMove] (FName Name, EModuleChangeReason Reason) mutable
|
||||
FModuleManager::Get().OnModulesChanged().AddLambda([this] (FName Name, EModuleChangeReason Reason)
|
||||
{
|
||||
if (Reason == EModuleChangeReason::ModuleLoaded && Name == "ImGui")
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user