Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on material deletion/rename #386

Closed
adriengivry opened this issue Feb 19, 2025 · 0 comments · Fixed by #392
Closed

Crash on material deletion/rename #386

adriengivry opened this issue Feb 19, 2025 · 0 comments · Fixed by #392
Assignees
Labels
Bug Something isn't working Crash Something that causes a crash Critical Something that should be fixed quickly Good First Issue An easy issue for new contributors
Milestone

Comments

@adriengivry
Copy link
Member

adriengivry commented Feb 19, 2025

Description
Crash when renaming/deleting a material.
Only happens when Overload.exe is located in a protected folder (which requires admin rights), i.e. "Program Files".
In EditorActions.cpp, we create a temporary file when propagating rename:

std::filesystem::copy_file("TEMP", entry.path(), std::filesystem::copy_options::overwrite_existing);
std::filesystem::remove("TEMP");

And creating this temporary file isn't permitted from a protected folder. We should instead use the operating system's provided temporary folder.

To Reproduce
Steps to reproduce the behavior:

  1. Move Overload build to "Program Files"
  2. Open the editor
  3. Delete or rename a material
  4. Notice the issue

Expected behavior
The editor shouldn't crash when deleting or renaming a material.

Screenshots
If applicable, add screenshots to help explain your problem.

Call Stack

KernelBase.dll!00007ff9944cfe3c()	Unknown
vcruntime140d.dll!00007ff89c7f9362()	Unknown
OvEditor.exe!std::filesystem::_Throw_fs_error(const char * _Op, __std_win_error _Error, const std::filesystem::path & _Path1, const std::filesystem::path & _Path2) Line 1862	C++
OvEditor.exe!std::filesystem::copy_file(const std::filesystem::path & _From, const std::filesystem::path & _To, const std::filesystem::copy_options _Options) Line 3418	C++
>	OvEditor.exe!OvEditor::Core::EditorActions::PropagateFileRenameThroughSavedFilesOfType(const std::string & p_previousName, const std::string & p_newName, OvTools::Utils::PathParser::EFileType p_fileType) Line 973	C++
OvEditor.exe!OvEditor::Core::EditorActions::PropagateFileRename(std::string p_previousName, std::string p_newName) Line 927	C++
OvEditor.exe!OvEditor::Panels::AssetBrowser::ConsiderItem::__l22::<lambda_10>::operator()(std::string p_prev, std::string p_newPath) Line 1321	C++
@adriengivry adriengivry added Bug Something isn't working Crash Something that causes a crash Critical Something that should be fixed quickly labels Feb 19, 2025
@adriengivry adriengivry changed the title Crash on material deletion Crash on material deletion/rename Feb 19, 2025
@adriengivry adriengivry added the Good First Issue An easy issue for new contributors label Feb 19, 2025
@adriengivry adriengivry added this to the 1.4 RC2 milestone Feb 20, 2025
@adriengivry adriengivry self-assigned this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Crash Something that causes a crash Critical Something that should be fixed quickly Good First Issue An easy issue for new contributors
Development

Successfully merging a pull request may close this issue.

1 participant