diff --git a/src/core/callback_table.h b/src/core/callback_table.h index 52c4fccdb8..608154ce0d 100644 --- a/src/core/callback_table.h +++ b/src/core/callback_table.h @@ -45,6 +45,7 @@ template class CallbackTable { void Get(uint32_t id, activity_rtapi_callback_t* callback, void** arg) const { assert(id < N && "id is out of range"); + assert(callback != nullptr && arg != nullptr && "invalid arguments"); std::lock_guard lock(mutex_); std::tie(*callback, *arg) = callbacks_[id]; } diff --git a/src/roctx/roctx.cpp b/src/roctx/roctx.cpp index 5bb959a354..c2a71bebe3 100644 --- a/src/roctx/roctx.cpp +++ b/src/roctx/roctx.cpp @@ -230,7 +230,7 @@ PUBLIC_API bool RegisterApiCallback(uint32_t op, void* callback, void* arg) { PUBLIC_API bool RemoveApiCallback(uint32_t op) { if (op >= ROCTX_API_ID_NUMBER) return false; - roctx::cb_table.Get(op, NULL, NULL); + roctx::cb_table.Set(op, nullptr, nullptr); return true; }