From 6ae3076ab7a156247689c7d5d3192c3396a08aec Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 23 Feb 2019 18:11:54 -0600 Subject: [PATCH] Moves the path return from fileDialog through the returnBuffer so it doesn't get mangled or corrupted in memory inadvertently. --- Engine/source/platform/nativeDialogs/fileDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/platform/nativeDialogs/fileDialog.cpp b/Engine/source/platform/nativeDialogs/fileDialog.cpp index 21bdfefa3..067458e9f 100644 --- a/Engine/source/platform/nativeDialogs/fileDialog.cpp +++ b/Engine/source/platform/nativeDialogs/fileDialog.cpp @@ -285,9 +285,9 @@ bool FileDialog::Execute() { // Single file selection, do it the easy way if(mForceRelativePath) - mData.mFile = Platform::makeRelativePathName(resultPath.c_str(), NULL); + mData.mFile = Con::getReturnBuffer(Platform::makeRelativePathName(resultPath.c_str(), NULL)); else - mData.mFile = resultPath.c_str(); + mData.mFile = Con::getReturnBuffer(resultPath.c_str()); } else if (mData.mStyle & FileDialogData::FDS_MULTIPLEFILES) {