diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2013-08-06 18:08:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-08-08 17:31:09 (GMT) |
commit | e43e207c7bbde2a9e0948da0d1e79879ccd5ce45 (patch) | |
tree | 4f04bfa4affb1ba933e93b63e1ea19ecf74e2531 /Source/cmVariableWatch.h | |
parent | 0d6acb1df8c20bb21f4d328cf2c35d0cbb6d7ea3 (diff) | |
download | CMake-e43e207c7bbde2a9e0948da0d1e79879ccd5ce45.zip CMake-e43e207c7bbde2a9e0948da0d1e79879ccd5ce45.tar.gz CMake-e43e207c7bbde2a9e0948da0d1e79879ccd5ce45.tar.bz2 |
variable_watch: Match client_data when finding duplicates
If a callback has the same data as another call, we don't want to delete
the old callback. This is because if the client_data is the same, it
might get deleted causing the new client_data to be bogus. Now, AddWatch
will return true if it will use the watch, false otherwise. Callers
should check the return value to know whether client_data was adopted by
the watch or not.
Diffstat (limited to 'Source/cmVariableWatch.h')
-rw-r--r-- | Source/cmVariableWatch.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index d666815..3b6cafd 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -34,7 +34,7 @@ public: /** * Add watch to the variable */ - void AddWatch(const std::string& variable, WatchMethod method, + bool AddWatch(const std::string& variable, WatchMethod method, void* client_data=0, DeleteData delete_data=0); void RemoveWatch(const std::string& variable, WatchMethod method); |