From 7777e8292137f5a9a7fb78ba36256240fd623f99 Mon Sep 17 00:00:00 2001 From: kevin Date: Wed, 30 Jan 2013 20:29:23 -0800 Subject: [PATCH] cmGrPlot.c: Changed op->userPtr release from _cmGrPlotObjDelete() to _cmGrPlotObjDestroy(). --- cmGrPlot.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmGrPlot.c b/cmGrPlot.c index a50a471..5b39684 100644 --- a/cmGrPlot.c +++ b/cmGrPlot.c @@ -103,12 +103,6 @@ cmGrPlRC_t _cmGrPlotObjDelete( cmGrPlotObj_t* op ) if( cmGrObjDestroy( op->grH, &op->grObjH ) != kOkGrRC ) return cmErrMsg( &p->err, kGrFailGrPlRC, "Delete failed on the object label='%s' id=%i\n",cmStringNullGuard( op->label ), cmGrObjId(op->grObjH) ); - if( op->userByteCnt != 0 ) - { - cmMemFree(op->userPtr); - op->userByteCnt = 0; - } - return kOkGrPlRC; } @@ -337,6 +331,13 @@ void _cmGrPlotObjDestroy( cmGrObjFuncArgs_t* args ) _cmGrPlotObjCb(op,kDestroyedCbSelGrPlId,0); _cmGrPlotObjUnlink( op ); + + if( op->userByteCnt != 0 ) + { + cmMemFree(op->userPtr); + op->userByteCnt = 0; + } + cmMemFree(op->label); cmMemFree(op); }