pw_sync_freertos: correct Mutex & Semaphore destructors

Although this is actually a no-op because the same pointer is used,
this corrects the destructors to use the handle instead of a
pointer to the native type to be locally consistent.

Change-Id: Ic790df6532c18d34e1c34c34e4a6fdb7ecb2a36f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/35882
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
diff --git a/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h b/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h
index 8a3562a..d666080 100644
--- a/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h
+++ b/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h
@@ -29,7 +29,9 @@
   PW_DASSERT(native_type_.handle != nullptr);
 }
 
-inline BinarySemaphore::~BinarySemaphore() { vSemaphoreDelete(&native_type_); }
+inline BinarySemaphore::~BinarySemaphore() {
+  vSemaphoreDelete(native_type_.handle);
+}
 
 inline void BinarySemaphore::release() {
   if (interrupt::InInterruptContext()) {
diff --git a/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h b/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h
index 9a3e95b..0dc116d 100644
--- a/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h
+++ b/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h
@@ -31,7 +31,7 @@
 }
 
 inline CountingSemaphore::~CountingSemaphore() {
-  vSemaphoreDelete(&native_type_);
+  vSemaphoreDelete(native_type_.handle);
 }
 
 inline void CountingSemaphore::acquire() {
diff --git a/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h b/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h
index 9ae4b7a..4c8fe6c 100644
--- a/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h
+++ b/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h
@@ -29,7 +29,7 @@
   PW_DASSERT(native_type_.handle != nullptr);
 }
 
-inline Mutex::~Mutex() { vSemaphoreDelete(&native_type_); }
+inline Mutex::~Mutex() { vSemaphoreDelete(native_type_.handle); }
 
 inline void Mutex::lock() {
   PW_ASSERT(!interrupt::InInterruptContext());