fix infinite recursion in weakref hash
Some checks failed
Build Binaries / Build Windows (push) Has been cancelled
Build Binaries / Build macOS (push) Has been cancelled
Build Binaries / Build Android (64-bit) (push) Has been cancelled
Build Binaries / Build Android (32-bit) (push) Has been cancelled
Build Binaries / Publish (push) Has been cancelled

This commit is contained in:
dankmeme01 2024-10-17 16:23:39 +02:00
parent b69f810dd4
commit d68e358bdd

View file

@ -971,7 +971,8 @@ namespace std {
template <typename T>
struct std::hash<geode::WeakRef<T>> {
size_t operator()(geode::WeakRef<T> const& ref) const {
return hash{}(ref.m_controller);
// the explicit template argument is needed here because it would otherwise cast to WeakRef and recurse
return hash<std::shared_ptr<geode::WeakRefController>>{}(ref.m_controller);
}
};
}