From 1e58692e6dc396e9a0b93cf0af95bdb2dcd14660 Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Wed, 5 Jul 2023 15:58:15 -0700 Subject: [PATCH] The channel data needs to be freed for some 2D Cider devices. This shows up with some of the examples/cider/parallel circuits. --- src/ciderlib/twod/twodest.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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);