diff --git a/engine/asset/include/assetptr.hpp b/engine/asset/include/assetptr.hpp index bf3b497..4dfd3c7 100644 --- a/engine/asset/include/assetptr.hpp +++ b/engine/asset/include/assetptr.hpp @@ -29,11 +29,13 @@ struct AssetPtr { } AssetPtr& operator=(const AssetPtr& rhs) { - handle = rhs.handle; - block = rhs.block; + if(&rhs != this) { + handle = rhs.handle; + block = rhs.block; - if(block != nullptr) - block->references++; + if (block != nullptr) + block->references++; + } return *this; }