mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[csharp] Fixed memory leak in Triangulator
This commit is contained in:
parent
11b402fcaf
commit
5b691065bf
@ -169,7 +169,10 @@ namespace Spine {
|
|||||||
if (polygon.Count > 0) {
|
if (polygon.Count > 0) {
|
||||||
convexPolygons.Add(polygon);
|
convexPolygons.Add(polygon);
|
||||||
convexPolygonsIndices.Add(polygonIndices);
|
convexPolygonsIndices.Add(polygonIndices);
|
||||||
}
|
} else {
|
||||||
|
polygonPool.Free(polygon);
|
||||||
|
polygonIndicesPool.Free(polygonIndices);
|
||||||
|
}
|
||||||
polygon = polygonPool.Obtain();
|
polygon = polygonPool.Obtain();
|
||||||
polygon.Clear();
|
polygon.Clear();
|
||||||
polygon.Add(x1);
|
polygon.Add(x1);
|
||||||
@ -244,6 +247,9 @@ namespace Spine {
|
|||||||
if (polygon.Count == 0) {
|
if (polygon.Count == 0) {
|
||||||
convexPolygons.RemoveAt(i);
|
convexPolygons.RemoveAt(i);
|
||||||
polygonPool.Free(polygon);
|
polygonPool.Free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices.Items[i];
|
||||||
|
convexPolygonsIndices.RemoveAt(i);
|
||||||
|
polygonIndicesPool.Free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user