Protect against self-assignment in AssetPtr
This commit is contained in:
parent
cc49340cd9
commit
f71fda776d
1 changed files with 6 additions and 4 deletions
|
@ -29,11 +29,13 @@ struct AssetPtr {
|
|||
}
|
||||
|
||||
AssetPtr& operator=(const AssetPtr& rhs) {
|
||||
if(&rhs != this) {
|
||||
handle = rhs.handle;
|
||||
block = rhs.block;
|
||||
|
||||
if(block != nullptr)
|
||||
if (block != nullptr)
|
||||
block->references++;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
|
Reference in a new issue