Compare commits

...

3 Commits

Author SHA1 Message Date
ww-rm
4983b1fa88 更新至v0.12.11 2025-05-08 18:35:23 +08:00
ww-rm
f6b6d9f0e7 update changelog 2025-05-08 18:35:12 +08:00
ww-rm
12a168df92 修复atlas null 引用导致的闪退 2025-05-08 18:34:43 +08:00
9 changed files with 34 additions and 15 deletions

View File

@@ -1,5 +1,10 @@
# CHANGELOG
## v0.12.11
- 修复可能的闪退错误
## v0.12.10
- 增加纹理全局加载选项

View File

@@ -50,7 +50,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject21(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -70,6 +71,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -96,7 +98,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -49,7 +49,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject36(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -69,6 +70,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -95,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -46,7 +46,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject37(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -66,6 +67,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -92,7 +94,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -50,7 +50,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject38(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -70,6 +71,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch (Exception ex)
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}", ex);
}
}
@@ -96,7 +98,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -48,7 +48,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject40(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -68,6 +69,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -95,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -48,7 +48,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject41(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -68,6 +69,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -95,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -48,7 +48,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject42(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -68,6 +69,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -95,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -7,7 +7,7 @@
<TargetFramework>net8.0-windows</TargetFramework>
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Version>0.12.10</Version>
<Version>0.12.11</Version>
<OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>appicon.ico</ApplicationIcon>