mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
[cocos2dx] Properly retain/release textures in attachemnt vertices. Closes #1442.
This commit is contained in:
parent
84c09c1bbc
commit
40d4cad434
@ -35,6 +35,7 @@ namespace spine {
|
|||||||
|
|
||||||
AttachmentVertices::AttachmentVertices (Texture2D* texture, int verticesCount, unsigned short* triangles, int trianglesCount) {
|
AttachmentVertices::AttachmentVertices (Texture2D* texture, int verticesCount, unsigned short* triangles, int trianglesCount) {
|
||||||
_texture = texture;
|
_texture = texture;
|
||||||
|
if (_texture) _texture->retain();
|
||||||
|
|
||||||
_triangles = new TrianglesCommand::Triangles();
|
_triangles = new TrianglesCommand::Triangles();
|
||||||
_triangles->verts = new V3F_C4B_T2F[verticesCount];
|
_triangles->verts = new V3F_C4B_T2F[verticesCount];
|
||||||
@ -46,6 +47,7 @@ AttachmentVertices::AttachmentVertices (Texture2D* texture, int verticesCount, u
|
|||||||
AttachmentVertices::~AttachmentVertices () {
|
AttachmentVertices::~AttachmentVertices () {
|
||||||
delete [] _triangles->verts;
|
delete [] _triangles->verts;
|
||||||
delete _triangles;
|
delete _triangles;
|
||||||
|
if (_texture) _texture->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user