Merge branch 'load_library_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-load_library_fix

This commit is contained in:
Wojtek Figat
2023-08-10 11:59:17 +02:00

View File

@@ -1191,11 +1191,8 @@ void* WindowsPlatform::LoadLibrary(const Char* filename)
folder = StringView::Empty; folder = StringView::Empty;
if (folder.HasChars()) if (folder.HasChars())
{ {
Char& end = ((Char*)folder.Get())[folder.Length()]; String folderNullTerminated(folder);
const Char c = end; SetDllDirectoryW(folderNullTerminated.Get());
end = 0;
SetDllDirectoryW(*folder);
end = c;
} }
// Avoiding windows dialog boxes if missing // Avoiding windows dialog boxes if missing