diff options
author | Tigran Gasparian <tigrang@google.com> | 2018-06-04 15:10:48 +0200 |
---|---|---|
committer | Tigran Gasparian <tigrang@google.com> | 2018-06-04 15:10:48 +0200 |
commit | bb72a91080d55819af15e1278fec8b70e94d8471 (patch) | |
tree | 27baa6c5e0826e5ce5257bd3f12fb7f03aeb9e33 /src/LinearMath/btHashMap.h | |
parent | e0667d857995eeba7944a6b2e7bf1dfe48bc8311 (diff) | |
download | bullet3-bb72a91080d55819af15e1278fec8b70e94d8471.tar.gz |
Clears the user data cache when syncUserData is called.
Adds unit test for the UserData functons.
Changes the char pointer in btHashString to std::string. There were
problems where the object owning the string memory would deallocate the
string, making the btHashString object invalid.
Diffstat (limited to 'src/LinearMath/btHashMap.h')
-rw-r--r-- | src/LinearMath/btHashMap.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/LinearMath/btHashMap.h b/src/LinearMath/btHashMap.h index f43e76a80..7965c11f6 100644 --- a/src/LinearMath/btHashMap.h +++ b/src/LinearMath/btHashMap.h @@ -17,12 +17,13 @@ subject to the following restrictions: #ifndef BT_HASH_MAP_H #define BT_HASH_MAP_H +#include <string> #include "btAlignedObjectArray.h" ///very basic hashable string implementation, compatible with btHashMap struct btHashString { - const char* m_string; + std::string m_string; unsigned int m_hash; SIMD_FORCE_INLINE unsigned int getHash()const @@ -71,7 +72,7 @@ struct btHashString bool equals(const btHashString& other) const { return (m_string == other.m_string) || - (0==portableStringCompare(m_string,other.m_string)); + (0==portableStringCompare(m_string.c_str(),other.m_string.c_str())); } |