diff --git a/Source/Editor/Windows/ContentWindow.ContextMenu.cs b/Source/Editor/Windows/ContentWindow.ContextMenu.cs index 1b4d2be31..f81220ac4 100644 --- a/Source/Editor/Windows/ContentWindow.ContextMenu.cs +++ b/Source/Editor/Windows/ContentWindow.ContextMenu.cs @@ -224,7 +224,7 @@ namespace FlaxEditor.Windows /// private void ExportSelection() { - if(FileSystem.ShowBrowseFolderDialog(Editor.Windows.MainWindow, null, "Select the output folder", out var outputFolder)) + if (FileSystem.ShowBrowseFolderDialog(Editor.Windows.MainWindow, null, "Select the output folder", out var outputFolder)) return; var selection = _view.Selection; diff --git a/Source/Engine/Platform/Windows/WindowsFileSystem.cpp b/Source/Engine/Platform/Windows/WindowsFileSystem.cpp index e30747961..1816c9552 100644 --- a/Source/Engine/Platform/Windows/WindowsFileSystem.cpp +++ b/Source/Engine/Platform/Windows/WindowsFileSystem.cpp @@ -297,11 +297,6 @@ bool WindowsFileSystem::ShowBrowseFolderDialog(Window* parentWindow, const Strin // Randomly generated GUID used for storing the last location of this dialog const Guid folderGuid(0x53890ed9, 0xa55e47ba, 0xa970bdae, 0x72acedff); - // Allocate memory for the filenames - int32 maxPathSize = 2 * MAX_PATH; - Array pathBuffer; - pathBuffer.EnsureCapacity(maxPathSize); - ComPtr fd; if (SUCCEEDED(CoCreateInstance(CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&fd)))) { @@ -327,15 +322,9 @@ bool WindowsFileSystem::ShowBrowseFolderDialog(Window* parentWindow, const Strin LPWSTR resultPath; if (SUCCEEDED(si->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, &resultPath))) { - int32 resultPathLength = StringUtils::Length(resultPath); - if (resultPathLength < pathBuffer.Capacity()) - { - StringUtils::Copy(pathBuffer.Get(), resultPath, resultPathLength); - CoTaskMemFree(resultPath); - - path = pathBuffer.Get(); - result = false; - } + path = resultPath; + CoTaskMemFree(resultPath); + result = false; } } }