From 5d305c30640b15f67f03b00d0aa0a3e1f5940ac8 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);