mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +00:00
add Equals and HashCode to managed pointer MCefRefPtr
This commit is contained in:
committed by
Dmitry Azaraev
parent
edee098fda
commit
58dd73a2dc
@@ -96,6 +96,21 @@ public:
|
||||
swap(%r._ptr);
|
||||
}
|
||||
|
||||
virtual bool Equals(Object^ obj) override
|
||||
{
|
||||
if(obj->GetType() == GetType())
|
||||
{
|
||||
MCefRefPtr^ other = safe_cast<MCefRefPtr^>(obj);
|
||||
return (*other)._ptr == _ptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual int GetHashCode() override
|
||||
{
|
||||
return (int)_ptr;
|
||||
}
|
||||
|
||||
private:
|
||||
T* _ptr;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user