mirror of https://github.com/axmolengine/axmol.git
fix copy construct & assignment operator memory leakage.
This commit is contained in:
parent
d2bc03f80f
commit
223d5a7a5c
|
@ -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];
|
||||||
|
|
Loading…
Reference in New Issue