Skip to content

Commit

Permalink
Remove jni refference for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
piaskowyk committed Sep 9, 2021
1 parent 1848b3b commit 520f624
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion Common/cpp/Tools/JSIStoreValueUser.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifdef ONANDROID
#include <AndroidScheduler.h>
#endif
#include <AndroidScheduler.h>
#include "JSIStoreValueUser.h"

Expand Down Expand Up @@ -26,14 +29,23 @@ StoreUser::~StoreUser() {
int id = identifier;
std::shared_ptr<Scheduler> strongScheduler = scheduler.lock();
if (strongScheduler != nullptr) {
#ifdef ONANDROID
jni::ThreadScope::WithClassLoader([&] {
strongScheduler->scheduleOnUI([id]() {
const std::lock_guard<std::recursive_mutex> lock(storeMutex);
if (StoreUser::store.count(id) > 0) {
StoreUser::store.erase(id);
}
});
});
#else
strongScheduler->scheduleOnUI([id]() {
const std::lock_guard<std::recursive_mutex> lock(storeMutex);
if (StoreUser::store.count(id) > 0) {
StoreUser::store.erase(id);
}
});
});
#endif
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/reanimated2/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const isConfigured = (throwError = false) => {
export const isConfiguredCheck = () => {
if (!isConfigured(true)) {
throw new Error(
'If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation'
'If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation'
);
}
};
Expand Down

0 comments on commit 520f624

Please sign in to comment.