0

私は問題があります

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--;
        }
}

これは、この時点でデストラクタを呼び出す適切な方法ですか?

4

0 に答える 0