Browse Source

cmGrPlot.c: Changed op->userPtr release from _cmGrPlotObjDelete() to _cmGrPlotObjDestroy().

master
kevin 11 years ago
parent
commit
7777e82921
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      cmGrPlot.c

+ 7
- 6
cmGrPlot.c View File

@@ -103,12 +103,6 @@ cmGrPlRC_t _cmGrPlotObjDelete( cmGrPlotObj_t* op )
103 103
   if( cmGrObjDestroy( op->grH, &op->grObjH ) != kOkGrRC )
104 104
     return cmErrMsg( &p->err, kGrFailGrPlRC, "Delete failed on the object label='%s' id=%i\n",cmStringNullGuard( op->label ), cmGrObjId(op->grObjH) );
105 105
  
106
-  if( op->userByteCnt != 0 )
107
-  {
108
-    cmMemFree(op->userPtr);
109
-    op->userByteCnt = 0;
110
-  }
111
-
112 106
   return kOkGrPlRC;
113 107
 }
114 108
 
@@ -337,6 +331,13 @@ void _cmGrPlotObjDestroy(  cmGrObjFuncArgs_t* args )
337 331
   _cmGrPlotObjCb(op,kDestroyedCbSelGrPlId,0);
338 332
 
339 333
   _cmGrPlotObjUnlink( op );
334
+  
335
+  if( op->userByteCnt != 0 )
336
+  {
337
+    cmMemFree(op->userPtr);
338
+    op->userByteCnt = 0;
339
+  }
340
+
340 341
   cmMemFree(op->label);
341 342
   cmMemFree(op);
342 343
 }

Loading…
Cancel
Save