mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[as3] Fixed memory leak in Triangulator
This commit is contained in:
parent
fdf6aba634
commit
11b402fcaf
Binary file not shown.
@ -175,6 +175,9 @@ package spine {
|
|||||||
if (polygon.length > 0) {
|
if (polygon.length > 0) {
|
||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
|
} else {
|
||||||
|
polygonPool.free(polygon);
|
||||||
|
polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
polygon = Vector.<Number>(this.polygonPool.obtain());
|
polygon = Vector.<Number>(this.polygonPool.obtain());
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
@ -250,6 +253,9 @@ package spine {
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i];
|
||||||
|
convexPolygonsIndices.splice(i, 1);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user