fix copy construct & assignment operator memory leakage.

This commit is contained in:
fusijie 2015-08-18 14:48:16 +08:00
parent d2bc03f80f
commit 223d5a7a5c
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ isVertsOwner(true),
rect() rect()
{ {
filename = other.filename; filename = other.filename;
isVertsOwner = other.isVertsOwner; isVertsOwner = true;
rect = other.rect; rect = other.rect;
triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount]; triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount];
triangles.indices = new unsigned short[other.triangles.indexCount]; triangles.indices = new unsigned short[other.triangles.indexCount];
@ -60,7 +60,7 @@ PolygonInfo& PolygonInfo::operator= (const PolygonInfo& other)
{ {
releaseVertsAndIndices(); releaseVertsAndIndices();
filename = other.filename; filename = other.filename;
isVertsOwner = other.isVertsOwner; isVertsOwner = true;
rect = other.rect; rect = other.rect;
triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount]; triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount];
triangles.indices = new unsigned short[other.triangles.indexCount]; triangles.indices = new unsigned short[other.triangles.indexCount];