From 3648bcab363284b31cd5d9ce4401c72d9b5ea8aa Mon Sep 17 00:00:00 2001 From: Shital Shah Date: Wed, 23 Aug 2017 14:25:52 -0700 Subject: [PATCH] move static module load inside function --- Unreal/Plugins/AirSim/Source/AirSimGameMode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Unreal/Plugins/AirSim/Source/AirSimGameMode.cpp b/Unreal/Plugins/AirSim/Source/AirSimGameMode.cpp index 4046e7e102..d38ef19d50 100644 --- a/Unreal/Plugins/AirSim/Source/AirSimGameMode.cpp +++ b/Unreal/Plugins/AirSim/Source/AirSimGameMode.cpp @@ -12,9 +12,6 @@ //#include //#endif -// Module loading is not allowed outside of the main thread, so we load the ImageWrapper module ahead of time. -static IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked(TEXT("ImageWrapper")); - class AUnrealLog : public msr::airlib::Utils::Logger { @@ -59,6 +56,9 @@ AAirSimGameMode::AAirSimGameMode(const FObjectInitializer& ObjectInitializer) HUDClass = ASimHUD::StaticClass(); common_utils::Utils::getSetLogger(&GlobalASimLog); + + //module loading is not allowed outside of the main thread, so we load the ImageWrapper module ahead of time. + static IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked(TEXT("ImageWrapper")); } void AAirSimGameMode::StartPlay()