diff --git a/ReactCommon/jsi/jsi/ScriptStore.h b/ReactCommon/jsi/jsi/ScriptStore.h index f98905ae8a..b74985cd5f 100644 --- a/ReactCommon/jsi/jsi/ScriptStore.h +++ b/ReactCommon/jsi/jsi/ScriptStore.h @@ -11,7 +11,7 @@ using ScriptVersion_t = uint64_t; // It shouldbe std::optional once w using JSRuntimeVersion_t = uint64_t; // 0 implies version can't be computed. We assert whenever that happens. struct VersionedBuffer { - std::unique_ptr buffer; + std::shared_ptr buffer; ScriptVersion_t version; }; @@ -34,7 +34,7 @@ struct PreparedScriptStore { // RuntimeSignature : Javascript engine type and version // prepareTag : Custom tag to uniquely identify JS engine specific preparation schemes. It is usually useful while experimentation and can be null. // It is possible that no prepared script is available for a given script & runtime signature. This method should null if so - virtual std::unique_ptr tryGetPreparedScript( + virtual std::shared_ptr tryGetPreparedScript( const ScriptSignature& scriptSignature, const JSRuntimeSignature& runtimeSignature, const char* prepareTag // Optional tag. For e.g. eagerly evaluated vs lazy cache.