restore file save

Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
monroegm-disable-blank-issue-2
chcurran 4 years ago
parent ca771f3adc
commit 6fb284ff0a

@ -1051,7 +1051,7 @@ namespace ScriptCanvasEditor
auto graph = entity->CreateComponent<ScriptCanvasEditor::Graph>();
entity->CreateComponent<EditorGraphVariableManagerComponent>(graph->GetScriptCanvasId());
if (ScriptCanvas::DataPtr data = AZStd::make_shared<ScriptCanvas::ScriptCanvasData>())
if (ScriptCanvas::DataPtr data = aznew ScriptCanvas::ScriptCanvasData())
{
data->m_scriptCanvasEntity.reset(entity);
graph->MarkOwnership(*data);

@ -97,23 +97,15 @@ namespace ScriptCanvasEditor
}
else
{
// #sc_editor_asset - skip save, narrow down the memory corruption
AZ::SystemTickBus::QueueFunction([this, tmpFileName]()
{
FileSaveResult result;
result.tempFileRemovalError = RemoveTempFile(tmpFileName);
m_onComplete(result);
});
// the actual move attempt
/*
auto moveResult = AZ::IO::SmartMove(tmpFileName.c_str(), target.c_str());
if (moveResult.GetResultCode() == AZ::IO::ResultCode::Success)
{
auto streamer = AZ::Interface<AZ::IO::IStreamer>::Get();
AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str());
// Bump the slice asset up in the asset processor's queue.
AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str());
AzFramework::AssetSystemRequestBus::Broadcast
(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str());
AZ::SystemTickBus::QueueFunction([this, tmpFileName]()
{
@ -124,17 +116,19 @@ namespace ScriptCanvasEditor
}
else
{
AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), false, "moving converted file to tmpFileName destination failed: %s, trying again", target.c_str());
AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), false
, "moving converted file to tmpFileName destination failed: %s, trying again", target.c_str());
auto streamer = AZ::Interface<AZ::IO::IStreamer>::Get();
AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str());
streamer->SetRequestCompleteCallback(flushRequest, [this, tmpFileName, target, remainingAttempts]([[maybe_unused]] AZ::IO::FileRequestHandle request)
streamer->SetRequestCompleteCallback(flushRequest
, [this, tmpFileName, target, remainingAttempts]([[maybe_unused]] AZ::IO::FileRequestHandle request)
{
// Continue saving.
AZ::SystemTickBus::QueueFunction([this, tmpFileName, target, remainingAttempts]() { PerformMove(tmpFileName, target, remainingAttempts - 1); });
AZ::SystemTickBus::QueueFunction(
[this, tmpFileName, target, remainingAttempts]() { PerformMove(tmpFileName, target, remainingAttempts - 1); });
});
streamer->QueueRequest(flushRequest);
}
**/
}
}

Loading…
Cancel
Save