Skip to content

fix: free __cxa_demangle allocations in SingleInstanceChecker#8964

Open
jingjing2222 wants to merge 4 commits intosoftware-mansion:mainfrom
jingjing2222:fix/single-instance-checker-demangle-leak
Open

fix: free __cxa_demangle allocations in SingleInstanceChecker#8964
jingjing2222 wants to merge 4 commits intosoftware-mansion:mainfrom
jingjing2222:fix/single-instance-checker-demangle-leak

Conversation

@jingjing2222
Copy link

@jingjing2222 jingjing2222 commented Feb 14, 2026

Summary

  • fix leak in SingleInstanceChecker by freeing __cxa_demangle result
  • apply same fix in both reanimated and worklets implementations
  • safely fallback to typeid(T).name() when demangling fails

Why

__cxa_demangle allocates memory that must be released with free.
The previous code copied into std::string but never freed the original buffer.

Scope

This fixes a deterministic native allocation leak in debug builds when these constructors run.

@jingjing2222 jingjing2222 force-pushed the fix/single-instance-checker-demangle-leak branch from 1a92828 to 0f43296 Compare February 15, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant