Fixed issues found by PVS-Studio

This commit is contained in:
Wojtek Figat
2024-09-09 18:21:59 +02:00
parent c62575612b
commit bbb0d36494
11 changed files with 31 additions and 34 deletions

View File

@@ -62,7 +62,8 @@ namespace FlaxEditor.Surface
/// <remarks>
/// The method calls the <see cref="ISurfaceContext.SurfaceData"/> setter to assign the result bytes. Sets null value if failed.
/// </remarks>
public virtual void Save()
/// <returns>True if failed, otherwise false.</returns>
public virtual bool Save()
{
var wasEdited = IsEdited;
@@ -71,19 +72,16 @@ namespace FlaxEditor.Surface
_context.CachedSurfaceMeta.Scale = ViewScale;
// Save context (and every modified child context)
bool failed = RootContext.Save();
if (failed)
{
// Error
return;
}
if (RootContext.Save())
return true;
// Clear flag
if (wasEdited)
{
Owner.OnSurfaceEditedChanged();
}
return false;
}
}
}