diff --git a/ReactCommon/react/renderer/uimanager/UIManager.cpp b/ReactCommon/react/renderer/uimanager/UIManager.cpp index 0d2857b49415..0416836946a7 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.cpp +++ b/ReactCommon/react/renderer/uimanager/UIManager.cpp @@ -22,6 +22,20 @@ namespace facebook::react { +ShadowNodeWrapper::~ShadowNodeWrapper() { + // implementation is kept empty as there is nothing necessary to do in destrutor + // however, it still needs to exist in order to act as a "key function" for + // the ShadowNodeWrapper class -- this allow for RTTI to work properly across + // the library boundaries (i.e. dynamic_cast that is used by isHostObject method) +} + +ShadowNodeListWrapper::~ShadowNodeListWrapper() { + // implementation is kept empty as there is nothing necessary to do in destrutor + // however, it still needs to exist in order to act as a "key function" for + // the ShadowNodeListWrapper class -- this allow for RTTI to work properly across + // the library boundaries (i.e. dynamic_cast that is used by isHostObject method) +} + static std::unique_ptr constructLeakCheckerIfNeeded( RuntimeExecutor const &runtimeExecutor) { #ifdef REACT_NATIVE_DEBUG diff --git a/ReactCommon/react/renderer/uimanager/primitives.h b/ReactCommon/react/renderer/uimanager/primitives.h index 101155f91afe..42128932e856 100644 --- a/ReactCommon/react/renderer/uimanager/primitives.h +++ b/ReactCommon/react/renderer/uimanager/primitives.h @@ -30,6 +30,10 @@ struct ShadowNodeWrapper : public jsi::HostObject { ShadowNodeWrapper(SharedShadowNode shadowNode) : shadowNode(std::move(shadowNode)) {} + // The below method needs to be out-of-line in order for the class to have + // at least one "key function" (see https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable) + ~ShadowNodeWrapper() override; + ShadowNode::Shared shadowNode; }; @@ -37,6 +41,10 @@ struct ShadowNodeListWrapper : public jsi::HostObject { ShadowNodeListWrapper(SharedShadowNodeUnsharedList shadowNodeList) : shadowNodeList(shadowNodeList) {} + // The below method needs to be out-of-line in order for the class to have + // at least one "key function" (see https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable) + ~ShadowNodeListWrapper() override; + SharedShadowNodeUnsharedList shadowNodeList; };