Skip to content

Commit

Permalink
fix issue (software-mansion#2154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymon20000 authored Jun 25, 2021
1 parent 067aa6e commit 17b8f66
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Common/cpp/Tools/JSIStoreValueUser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ StoreUser::~StoreUser() {
int id = identifier;
std::shared_ptr<Scheduler> strongScheduler = scheduler.lock();
if (strongScheduler != nullptr) {
strongScheduler->scheduleOnUI([id, this]() {
const std::lock_guard<std::recursive_mutex> lock(storeUserData->storeMutex);
if (storeUserData->store.count(id) > 0) {
storeUserData->store.erase(id);
std::shared_ptr<StaticStoreUser> sud = storeUserData;
strongScheduler->scheduleOnUI([id, sud]() {
const std::lock_guard<std::recursive_mutex> lock(sud->storeMutex);
if (sud->store.count(id) > 0) {
sud->store.erase(id);
}
});
}
Expand Down

0 comments on commit 17b8f66

Please sign in to comment.