From 7d6f09f5c75d5703f33d8cc00d3698e5c5727009 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 1 Sep 2020 00:09:41 -0700 Subject: [PATCH] [sim] SimDataValue: Fix cancellation The uid was getting incremented by 1 during registration but not decremented by 1 during cancellation, so cancellation didn't work correctly. As the underlying registration ensures a non-zero result, don't increment the result. --- hal/src/main/native/include/hal/simulation/SimDataValue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/src/main/native/include/hal/simulation/SimDataValue.h b/hal/src/main/native/include/hal/simulation/SimDataValue.h index 360664e464..ff333a5c34 100644 --- a/hal/src/main/native/include/hal/simulation/SimDataValue.h +++ b/hal/src/main/native/include/hal/simulation/SimDataValue.h @@ -53,7 +53,7 @@ class SimDataValueBase : protected SimCallbackRegistryBase { lock.unlock(); callback(name, param, &value); } - return newUid + 1; + return newUid; } void DoSet(T value, const char* name) {