Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ReactCommon/react/renderer/uimanager/UIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<LeakChecker> constructLeakCheckerIfNeeded(
RuntimeExecutor const &runtimeExecutor) {
#ifdef REACT_NATIVE_DEBUG
Expand Down
8 changes: 8 additions & 0 deletions ReactCommon/react/renderer/uimanager/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@ 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;
};

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;
};

Expand Down