删除Spine UI对象时,释放模型资源

dev_chengFeng
Genkins 2020-08-05 21:20:13 +08:00
parent 73f79d1193
commit 7dd6f75e24
1 changed files with 18 additions and 2 deletions

View File

@ -294,6 +294,22 @@ namespace Spine.Unity {
//this.UpdateMaterial(); // TODO: This allocates memory.
}
#endregion
}
protected override void OnDestroy()
{
if( meshBuffers != null)
{
var c = meshBuffers.GetCurrent();
if( c != null)
c.Dispose();
var n = meshBuffers.GetNext();
if( n != null)
{
n.Dispose();
}
}
}
#endregion
}
}