Skip to content

Fix memory leaks in Spine resource parsing on the web-side.#65

Merged
star-e merged 3 commits intococos:v4.0.0from
bofeng-song:memory-leak
Feb 3, 2026
Merged

Fix memory leaks in Spine resource parsing on the web-side.#65
star-e merged 3 commits intococos:v4.0.0from
bofeng-song:memory-leak

Conversation

@bofeng-song
Copy link
Copy Markdown
Contributor

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

SkeletonData* SpineWasmUtil::createSpineSkeletonDataWithJson(const String& jsonStr, const String& altasStr, const spine::Vector<spine::String>& textureNames, const spine::Vector<spine::String>& textureUUIDs) {
SkeletonData* skeletonData = nullptr;
#if ENABLE_JSON_PARSER
auto* atlas = new Atlas(altasStr.buffer(), altasStr.length(), "", nullptr, false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use std::unique_ptr<Atlas> ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart pointers may increase the size of WASM binary files.

@bofeng-song bofeng-song closed this Feb 3, 2026
@bofeng-song bofeng-song reopened this Feb 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1010312 bytes 1010312 bytes ✅ 0 bytes
2D All (legacy pipeline) 2675978 bytes 2676004 bytes ⚠️ +26 bytes
2D All (new pipeline) 2767716 bytes 2767742 bytes ⚠️ +26 bytes
(2D + 3D) All 10024712 bytes 10024738 bytes ⚠️ +26 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16843280 bytes 16843378 bytes ⚠️ +98 bytes

Interface Check Report

This pull request does not change any public interfaces !

@star-e star-e closed this Feb 3, 2026
@star-e star-e reopened this Feb 3, 2026
@star-e star-e merged commit 535a593 into cocos:v4.0.0 Feb 3, 2026
81 of 109 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

@bofeng-song ❗ There was an error during the execution of the tasks. Please check the logs for more details.

bofeng-song added a commit to bofeng-song/cocos4 that referenced this pull request Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants