我有一个列表结构:
typedef struct FaceNode{
FaceNode *next;
Face *aFace;
FaceNode *prev;
} FaceNode;
我将此结构用作成员:
FaceNode *myFaces;
并像这样初始化它(在构造函数中)
this->myFaces = (FaceNode*)malloc(sizeof(FaceNode)*1);
后来我想按如下方式释放它:
FaceNode *theCurrentFaceNode;
Face* theCurrentFace;
while(this->myFaces->next){
theCurrentFaceNode = this->myFaces;
theCurrentFace = theCurrentFaceNode->aFace;
this->myFaces = this->myFaces->next;
free(theCurrentFace);
free(theCurrentFaceNode);
}
现在我的 IDE 告诉我:“错误,函数调用中的参数太多”对于免费调用。
那有什么问题呢?
干杯