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
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,9 @@ private Task<ReactInstance> getOrCreateReloadTask(String reason) {

final ReactContext reactContext = mBridgelessReactContextRef.getNullable();
if (reactContext != null) {
log(method, "Resetting ReactContext ref");
mBridgelessReactContextRef.reset();

log(method, "Destroying ReactContext");
reactContext.destroy();
}
Expand All @@ -1439,20 +1442,17 @@ private Task<ReactInstance> getOrCreateReloadTask(String reason) {
raiseSoftException(
method, "Skipping ReactInstance.destroy(): ReactInstance null");
} else {
log(method, "Resetting ReactInstance ptr");
mReactInstance = null;

log(method, "Destroying ReactInstance");
reactInstance.destroy();
}

log(method, "Resetting ReactContext ref");
mBridgelessReactContextRef.reset();

log(method, "Resetting ReactInstance task ref");
log(method, "Resetting createReactInstance task ref");
mCreateReactInstanceTaskRef.reset();

log(method, "Resetting ReactInstance ptr");
mReactInstance = null;

log(method, "Resetting preload task ref");
log(method, "Resetting start task ref");
mStartTask = null;

// Kickstart a new ReactInstance create
Expand All @@ -1462,7 +1462,7 @@ private Task<ReactInstance> getOrCreateReloadTask(String reason) {
.continueWithTask(
task -> {
final ReactInstance reactInstance =
reactInstanceTaskUnwrapper.unwrap(task, "7: Restarting surfaces");
reactInstanceTaskUnwrapper.unwrap(task, "6: Restarting surfaces");

if (reactInstance == null) {
raiseSoftException(method, "Skipping surface restart: ReactInstance null");
Expand Down
26 changes: 15 additions & 11 deletions packages/react-native/ReactCommon/react/renderer/core/PropsMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,19 @@
struct, blockStart, prefix "BlockStart" suffix, rawValue)

// Rebuild a type that contains multiple fields from a single field value
#define REBUILD_FIELD_SWITCH_CASE( \
defaults, rawValue, property, field, fieldName) \
case CONSTEXPR_RAW_PROPS_KEY_HASH(fieldName): { \
if ((rawValue).hasValue()) { \
decltype((defaults).field) res; \
fromRawValue(context, rawValue, res); \
(property).field = res; \
} else { \
(property).field = (defaults).field; \
} \
return; \
#define REBUILD_FIELD_SWITCH_CASE( \
defaults, rawValue, property, field, fieldName) \
case CONSTEXPR_RAW_PROPS_KEY_HASH(fieldName): { \
if ((rawValue).hasValue()) [[likely]] { \
try { \
fromRawValue(context, rawValue, (property).field); \
} catch (const std::exception& e) { \
LOG(ERROR) << "Error while converting prop '" << fieldName \
<< "': " << e.what(); \
(property).field = (defaults).field; \
} \
} else { \
(property).field = (defaults).field; \
} \
return; \
}