SaveTool: ensure old_filename isn't SSO'd so it can be released.

This commit is contained in:
Guillaume Jacquemin 2022-03-28 09:46:29 +02:00
parent bde6fc41a0
commit bf3288772e

View file

@ -20,7 +20,6 @@
#include <Corrade/Containers/Pair.h>
#include <Corrade/Containers/ScopeGuard.h>
#include <Corrade/Containers/StringStl.h>
#include <Corrade/Utility/Format.h>
#include <Corrade/Utility/Path.h>
#include <Corrade/Utility/String.h>
@ -210,7 +209,7 @@ void SaveTool::handleFileAction(efsw::WatchID watch_id,
event.user.code = action;
event.user.data1 = Containers::String{Containers::AllocatedInit, filename.c_str()}.release();
if(action == efsw::Actions::Moved) {
event.user.data2 = Containers::String{old_filename}.release();
event.user.data2 = Containers::String{Containers::AllocatedInit, old_filename.c_str()}.release();
}
SDL_PushEvent(&event);