From 52d27ae6bdb8543503d466328b9956bd2af7c71d Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Sat, 25 Mar 2023 14:59:42 +0800 Subject: [PATCH] Fixed issues where scripts cannot be loaded if another instance of the engine is using it --- SHADE_Managed/src/Engine/EngineInterface.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SHADE_Managed/src/Engine/EngineInterface.cxx b/SHADE_Managed/src/Engine/EngineInterface.cxx index ca7c6e77..ebb048a5 100644 --- a/SHADE_Managed/src/Engine/EngineInterface.cxx +++ b/SHADE_Managed/src/Engine/EngineInterface.cxx @@ -116,8 +116,9 @@ namespace SHADE try { oss << "[EngineInterface] Loading " << Convert::ToNative(ManagedLibraryName) << ".dll"; - managedLibFile = File::Open(managedLibPath, FileMode::Open, FileAccess::Read); + managedLibFile = File::Open(managedLibPath, FileMode::Open, FileAccess::Read, FileShare::Read); scriptContext->LoadFromStream(managedLibFile); + managedLibFile->Close(); oss.str(""); oss << "[EngineInterface] Successfully loaded " << Convert::ToNative(ManagedLibraryName) << ".dll"; Debug::Log(oss.str());