diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-09-25 15:06:00 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-09-25 15:06:00 (GMT) |
commit | b502515ad1a41b6487d3883db0c133f6e4fe4fe4 (patch) | |
tree | 86d576ab3af78232b0dfca429158b3181c8744db /Source/cmVTKWrapTclCommand.cxx | |
parent | ee57ae27cb483eb56974df49051513ca19bf1568 (diff) | |
download | CMake-b502515ad1a41b6487d3883db0c133f6e4fe4fe4.zip CMake-b502515ad1a41b6487d3883db0c133f6e4fe4fe4.tar.gz CMake-b502515ad1a41b6487d3883db0c133f6e4fe4fe4.tar.bz2 |
memory leak
Diffstat (limited to 'Source/cmVTKWrapTclCommand.cxx')
-rw-r--r-- | Source/cmVTKWrapTclCommand.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmVTKWrapTclCommand.cxx b/Source/cmVTKWrapTclCommand.cxx index 9dd4904..66ba407 100644 --- a/Source/cmVTKWrapTclCommand.cxx +++ b/Source/cmVTKWrapTclCommand.cxx @@ -269,6 +269,14 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName, /* create an extern ref to the generic delete function */ fprintf(fout,"\nextern void vtkTclGenericDeleteObject(ClientData cd);\n"); + if (!strcmp(kitName,"Vtkcommontcl")) + { + fprintf(fout,"void vtkCommonDeleteAssocData(ClientData cd, Tcl_Interp *)\n"); + fprintf(fout," {\n"); + fprintf(fout," vtkTclInterpStruct *tis = static_cast<vtkTclInterpStruct*>(cd);\n"); + fprintf(fout," delete tis;\n }\n"); + } + /* the main declaration */ fprintf(fout,"\n\nint VTK_EXPORT %s_SafeInit(Tcl_Interp *interp)\n{\n",kitName); fprintf(fout," return %s_Init(interp);\n}\n",kitName); @@ -290,7 +298,7 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName, fprintf(fout, " Tcl_InitHashTable(&info->CommandLookup, TCL_STRING_KEYS);\n"); fprintf(fout, - " Tcl_SetAssocData(interp,(char *) \"vtk\",NULL,(ClientData *)info);\n"); + " Tcl_SetAssocData(interp,(char *) \"vtk\",vtkCommonDeleteAssocData,(ClientData *)info);\n"); /* create special vtkCommand command */ fprintf(fout," Tcl_CreateCommand(interp,(char *) \"vtkCommand\",vtkCommand,\n (ClientData *)NULL, NULL);\n\n"); |