From 222b04f6d9a73d202faea473ab1c5c7991ca75e6 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Tue, 17 Sep 2002 10:38:34 -0400 Subject: [PATCH] added Destructor --- Tests/LoadCommand/CMakeCommands/cmTestCommand.c | 10 ++++++++++ .../LoadCommandOneConfig/CMakeCommands/cmTestCommand.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c index a4005dcd0..f1e1f214c 100644 --- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c +++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c @@ -45,6 +45,15 @@ void FinalPass(void *inf, void *mf) } } +void Destructor(void *inf) +{ + cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; + // get our client data from initial pass + cmVTKWrapTclData *cdata = + (cmVTKWrapTclData *)info->CAPI->GetClientData(info); + free(cdata); +} + CM_PLUGIN_EXPORT const char *cmGetName() { return "CMAKE_TEST_COMMAND"; @@ -54,6 +63,7 @@ void CM_PLUGIN_EXPORT cmInitializeCommand(cmLoadedCommandInfo *info) { info->InitialPass = InitialPass; info->FinalPass = FinalPass; + info->Destructor = Destructor; info->m_Inherited = 0; } diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c index a4005dcd0..f1e1f214c 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c +++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c @@ -45,6 +45,15 @@ void FinalPass(void *inf, void *mf) } } +void Destructor(void *inf) +{ + cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; + // get our client data from initial pass + cmVTKWrapTclData *cdata = + (cmVTKWrapTclData *)info->CAPI->GetClientData(info); + free(cdata); +} + CM_PLUGIN_EXPORT const char *cmGetName() { return "CMAKE_TEST_COMMAND"; @@ -54,6 +63,7 @@ void CM_PLUGIN_EXPORT cmInitializeCommand(cmLoadedCommandInfo *info) { info->InitialPass = InitialPass; info->FinalPass = FinalPass; + info->Destructor = Destructor; info->m_Inherited = 0; }