mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp (#25884)
Summary: Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp Issue: https://github.com/facebook/react-native/issues/25664 Reproducible repo: https://github.com/bhandarijiwan/memory_issue_repro ## Changelog [JSC] [JSCRuntime.cpp] - Added missing JSStringRelease calls in missing places Pull Request resolved: https://github.com/facebook/react-native/pull/25884 Test Plan: Tested that is no memory leak with various NativeModule to JS call flows Reviewed By: JoshuaGross Differential Revision: D16928985 Pulled By: TheSavior fbshipit-source-id: 65ce15ae32482d0db39bad7e22a2fed9ee04f230
This commit is contained in:
@@ -630,7 +630,9 @@ jsi::String JSCRuntime::createStringFromUtf8(
|
||||
size_t length) {
|
||||
std::string tmp(reinterpret_cast<const char*>(str), length);
|
||||
JSStringRef stringRef = JSStringCreateWithUTF8CString(tmp.c_str());
|
||||
return createString(stringRef);
|
||||
auto result = createString(stringRef);
|
||||
JSStringRelease(stringRef);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string JSCRuntime::utf8(const jsi::String& str) {
|
||||
|
||||
Reference in New Issue
Block a user