From 91031c7dad786aa96eec5f8876abf04d35ec8bad Mon Sep 17 00:00:00 2001 From: zhakesi Date: Fri, 18 Nov 2022 10:10:16 +0800 Subject: [PATCH] fix release spine/dragonbones resouce (#13419) --- .../dragonbones-creator-support/CCArmatureCacheDisplay.cpp | 1 + .../spine-creator-support/SkeletonCacheAnimation.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp b/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp index 7526735983..4b2b8a5fc9 100644 --- a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp +++ b/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp @@ -54,6 +54,7 @@ CCArmatureCacheDisplay::CCArmatureCacheDisplay(const std::string &armatureName, _armatureCache->addRef(); } else { _armatureCache = new ArmatureCache(armatureName, armatureKey, atlasUUID); + _armatureCache->addRef(); } // store global TypedArray begin and end offset diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp b/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp index 1b1a5970c1..92732b1095 100644 --- a/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp +++ b/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp @@ -54,6 +54,7 @@ SkeletonCacheAnimation::SkeletonCacheAnimation(const std::string &uuid, bool isS _skeletonCache->addRef(); } else { _skeletonCache = new SkeletonCache(); + _skeletonCache->addRef(); _skeletonCache->initWithUUID(uuid); }