diff options
-rw-r--r-- | dep/acelite/ace/OS_NS_Thread.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dep/acelite/ace/OS_NS_Thread.cpp b/dep/acelite/ace/OS_NS_Thread.cpp index 8e36eb9e4f7..c450bc81371 100644 --- a/dep/acelite/ace/OS_NS_Thread.cpp +++ b/dep/acelite/ace/OS_NS_Thread.cpp @@ -885,8 +885,12 @@ ACE_TSS_Cleanup::thread_detach_key (ACE_thread_key_t key) ACE_TSS_CLEANUP_GUARD u_int key_index = key; - ACE_ASSERT (key_index < sizeof(this->table_)/sizeof(this->table_[0]) - && this->table_[key_index].key_ == key); + ACE_ASSERT (key_index < sizeof(this->table_)/sizeof(this->table_[0])); + // If this entry was never set, just bug out. If it is set, but is the + // wrong key, assert. + if (this->table_[key_index].key_ == 0) + return 0; + ACE_ASSERT(this->table_[key_index].key_ == key); ACE_TSS_Info &info = this->table_ [key_index]; // sanity check |