handle self-assign (#1331)

This commit is contained in:
Dennis Brakhane
2025-11-26 08:21:12 +01:00
committed by GitHub
parent fc6cb8cba7
commit 051bfb6020
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -546,6 +546,7 @@ namespace wi::allocator
}
Allocation& operator=(const Allocation& other)
{
if (&other == this) return *this;
Reset();
allocator = other.allocator;
internal_state = other.internal_state;
+1
View File
@@ -86,6 +86,7 @@ namespace wi
function& operator=(const function& other)
{
if (&other == this) return *this;
destroy();
if (other.ptr)
{