Skip to content

Commit

Permalink
Apply requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmccall committed Jan 10, 2025
1 parent bd995b5 commit db174c8
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ private native HybridData initHybrid(

public native void performOperations();

public native void invalidateCpp();

@Override
protected HybridData getHybridData() {
return mHybridData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ void NativeProxy::commonInit(
}
#endif // RCT_NEW_ARCH_ENABLED

void NativeProxy::invalidateCpp() {
javaPart_ = nullptr;
layoutAnimations_->cthis()->invalidate();
}

NativeProxy::~NativeProxy() {
// removed temporary, new event listener mechanism need fix on the RN side
// reactScheduler_->removeEventListener(eventListener_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
std::shared_ptr<ReanimatedModuleProxy> reanimatedModuleProxy_;
jni::global_ref<LayoutAnimations::javaobject> layoutAnimations_;

void invalidateCpp();

#ifndef NDEBUG
void checkJavaVersion(jsi::Runtime &);
void injectCppVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void AndroidUIScheduler::scheduleTriggerOnUI() {
method(javaPart_.get());
}

void AndroidUIScheduler::invalidateCpp() {
void AndroidUIScheduler::invalidate() {
javaPart_ = nullptr;
uiScheduler_.reset();
}
Expand All @@ -59,7 +59,7 @@ void AndroidUIScheduler::registerNatives() {
registerHybrid({
makeNativeMethod("initHybrid", AndroidUIScheduler::initHybrid),
makeNativeMethod("triggerUI", AndroidUIScheduler::triggerUI),
makeNativeMethod("invalidateCpp", AndroidUIScheduler::invalidateCpp),
makeNativeMethod("invalidate", AndroidUIScheduler::invalidate),
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AndroidUIScheduler : public jni::HybridClass<AndroidUIScheduler> {

void triggerUI();

void invalidateCpp();
void invalidate();

jni::global_ref<AndroidUIScheduler::javaobject> javaPart_;
std::shared_ptr<UIScheduler> uiScheduler_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public AndroidUIScheduler(ReactApplicationContext context) {

public native void triggerUI();

public native void invalidateCpp();
public native void invalidate();

@DoNotStrip
private void scheduleTriggerOnUI() {
Expand All @@ -46,6 +46,6 @@ public void runGuarded() {

public void deactivate() {
mActive.set(false);
invalidateCpp();
invalidate();
}
}

0 comments on commit db174c8

Please sign in to comment.