CIDER: Plug some memory leaks by adding to TWOdestroy()

This commit is contained in:
Holger Vogt 2023-06-02 19:44:34 +02:00
parent 3bb9cd738f
commit 67b2ddbad5
1 changed files with 13 additions and 0 deletions

View File

@ -66,9 +66,22 @@ TWOdestroy(TWOdevice *pDevice)
FREE( pElem );
}
FREE( pDevice->elements );
for (int xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) {
FREE(pDevice->elemArray[xIndex]);
}
FREE( pDevice->elemArray );
}
if (pDevice->pMaterials) {
TWOmaterial* pMtmp = pDevice->pMaterials;
while (pMtmp) {
TWOmaterial* pMtmpnext = pMtmp->next;
FREE(pMtmp);
pMtmp = pMtmpnext;
}
}
/* destroy the contacts & channels */
/* NOT IMPLEMENTED */