Avoid potential memory leak

This commit is contained in:
Chris Young 2016-12-06 17:54:58 +00:00
parent 2dd97b0b8e
commit f38b72a583

View File

@ -119,18 +119,18 @@ void FreeObjList(struct MinList *objlist)
struct nsObject *node;
struct nsObject *nnode;
if(IsMinListEmpty((struct MinList *)objlist)) return;
node = (struct nsObject *)GetHead((struct List *)objlist);
do {
nnode=(struct nsObject *)GetSucc((struct Node *)node);
if(node->Type == AMINS_RECT) {
DelObjectNoFree(node);
} else {
DelObject(node);
}
} while((node=nnode));
if(IsMinListEmpty((struct MinList *)objlist) == FALSE) {
node = (struct nsObject *)GetHead((struct List *)objlist);
do {
nnode = (struct nsObject *)GetSucc((struct Node *)node);
if(node->Type == AMINS_RECT) {
DelObjectNoFree(node);
} else {
DelObject(node);
}
} while((node = nnode));
}
free(objlist);
}