[unity] Handle null pool in SkeletonGhost.OnDestroy() (#979)

This commit is contained in:
Serhii Yolkin 2017-09-01 10:26:53 +02:00 committed by John
parent 92c557e6ba
commit ad1279a71f

View File

@ -155,8 +155,10 @@ namespace Spine.Unity.Modules {
}
void OnDestroy () {
for (int i = 0; i < maximumGhosts; i++)
if (pool[i] != null) pool[i].Cleanup();
if (pool != null) {
for (int i = 0; i < maximumGhosts; i++)
if (pool[i] != null) pool[i].Cleanup();
}
foreach (var mat in materialTable.Values)
Destroy(mat);