summaryrefslogtreecommitdiffstats
path: root/Source/cmVariableWatch.cxx
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2013-08-02 19:44:15 (GMT)
committerBrad King <brad.king@kitware.com>2013-08-08 17:31:09 (GMT)
commit0d6acb1df8c20bb21f4d328cf2c35d0cbb6d7ea3 (patch)
tree677af4bf1f9b6492ad012c86d638a3510f39e8ba /Source/cmVariableWatch.cxx
parentfc7c3b4dc8522ad489a6fb67ac6030f302c65df3 (diff)
downloadCMake-0d6acb1df8c20bb21f4d328cf2c35d0cbb6d7ea3.zip
CMake-0d6acb1df8c20bb21f4d328cf2c35d0cbb6d7ea3.tar.gz
CMake-0d6acb1df8c20bb21f4d328cf2c35d0cbb6d7ea3.tar.bz2
variable_watch: Add a deleter for the client data
The client data is arbitrary and the callback may be called an unspecified number of times, so the cmVariableWatch must be the one to delete the client data in the end (if it is needed at all).
Diffstat (limited to 'Source/cmVariableWatch.cxx')
-rw-r--r--Source/cmVariableWatch.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index 21b910d..21acd3b 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -53,11 +53,13 @@ cmVariableWatch::~cmVariableWatch()
}
void cmVariableWatch::AddWatch(const std::string& variable,
- WatchMethod method, void* client_data /*=0*/)
+ WatchMethod method, void* client_data /*=0*/,
+ DeleteData delete_data /*=0*/)
{
cmVariableWatch::Pair* p = new cmVariableWatch::Pair;
p->Method = method;
p->ClientData = client_data;
+ p->DeleteDataCall = delete_data;
cmVariableWatch::VectorOfPairs* vp = &this->WatchMap[variable];
cmVariableWatch::VectorOfPairs::size_type cc;
for ( cc = 0; cc < vp->size(); cc ++ )