diff --git a/src/ciderlib/twod/twodest.c b/src/ciderlib/twod/twodest.c index 232c39867..e8e066469 100644 --- a/src/ciderlib/twod/twodest.c +++ b/src/ciderlib/twod/twodest.c @@ -74,6 +74,15 @@ TWOdestroy(TWOdevice *pDevice) FREE( pDevice->elemArray ); } + if (pDevice->pChannel) { + TWOchannel* pCtmp = pDevice->pChannel; + while (pCtmp) { + TWOchannel* pCtmpnext = pCtmp->next; + FREE(pCtmp); + pCtmp = pCtmpnext; + } + } + if (pDevice->pMaterials) { TWOmaterial* pMtmp = pDevice->pMaterials; while (pMtmp) { @@ -105,9 +114,6 @@ TWOdestroy(TWOdevice *pDevice) FREE(pDevice->yScale); } - /* destroy the channels */ - /* NOT IMPLEMENTED */ - FREE( pDevice ); { CiderLoaded(-1);