我遇到了问题
class Polygon
{
private:
Vertex* vertices;
int numVerts;
static int RefCount;
public:
//Constructors
Polygon(Vertex vert[], int numVerts){
vertices = vert;
this->numVerts = numVerts;
}
Polygon() {
vertices = 0;
numVerts = 0;
}
~Polygon() {
}
ReleasePolygon()
{
if (RefCount == 0)
delete this; // <-------- is this line ok?
else
RefCount--;
}
}
这是否是此时调用析构函数的正确方法?