From a112c6b6a2b318d7c35cb01509d7679d7453321c Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 28 Sep 2013 12:31:21 -0700 Subject: [PATCH] cmGrPlot.c : _cmGrPlotObjDestroy() now checks if the object about to be destroyed is the focused object and updates p->fop accordingly. --- cmGrPlot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmGrPlot.c b/cmGrPlot.c index 2c580eb..68b0a39 100644 --- a/cmGrPlot.c +++ b/cmGrPlot.c @@ -92,6 +92,7 @@ cmGrPlotObj_t* _cmGrPlObjHandleToPtr( cmGrPlObjH_t oh ) return op; } +// Destroy the embedded cmGrH_t object cmGrPlRC_t _cmGrPlotObjDelete( cmGrPlotObj_t* op ) { if( op==NULL || cmGrObjIsValid( op->grH, op->grObjH)==false ) @@ -323,6 +324,13 @@ void _cmGrPlotObjDestroy( cmGrObjFuncArgs_t* args ) { cmGrPlotObj_t* op = args->cbArg; + // if the focused op is being destroyed + if( op->p->fop == op ) + { + _cmGrPlotObjCb(op->p->fop, kStateChangeGrPlId, kFocusGrPlFl ); + op->p->fop = NULL; + } + // TODO: is it possible to prevent destruction by returning // 'false' from the used defined callback. This feature is // slightly complicated by the fact