Skip to content

Commit 1d45b20

Browse files
JunielKatarnfacebook-github-bot
authored andcommitted
Set CxxModule instance before retrieving Method vector (#32719)
Summary: Allows `CxxModule` objects to set their `instance_` member before `getMethods()` is invoked, allowing for the `Method` callbacks to capture a weak reference to `getInstance()` if needed. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Set CxxModules' Instance before retrieving their Method vector. Pull Request resolved: #32719 Test Plan: Ensure this statement swap does not break any scenarios with existing CI validation. Reviewed By: JoshuaGross Differential Revision: D32955616 Pulled By: genkikondo fbshipit-source-id: fd7a23ca2c12c01882ff1600f5aef86b1fe4a984
1 parent 89faf0c commit 1d45b20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactCommon/cxxreact/CxxNativeModule.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ void CxxNativeModule::lazyInit() {
244244
module_ = provider_();
245245
provider_ = nullptr;
246246
if (module_) {
247-
methods_ = module_->getMethods();
248247
module_->setInstance(instance_);
248+
methods_ = module_->getMethods();
249249
}
250250
}
251251

0 commit comments

Comments
 (0)