use IntrusivePtr to share object (#11729)

This commit is contained in:
minggo
2022-06-28 18:01:47 +08:00
committed by GitHub
parent d008270ef3
commit 8caec59711
40 changed files with 83 additions and 116 deletions
@@ -45,13 +45,11 @@ ccstd::unordered_map<Format, Feature, EnumHasher> featureCheckMap{};
TextureValidator::TextureValidator(Texture *actor)
: Agent<Texture>(actor) {
CC_SAFE_ADD_REF(actor);
_typedID = actor->getTypedID();
}
TextureValidator::~TextureValidator() {
DeviceResourceTracker<Texture>::erase(this);
if (_ownTheActor) CC_SAFE_RELEASE(_actor);
}
void TextureValidator::doInit(const TextureInfo &info) {