Skip to content

Commit

Permalink
fix: Sync before destroying
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Apr 29, 2024
1 parent 524f68d commit 6eacc14
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cpp/MmkvHostObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ MmkvHostObject::~MmkvHostObject() {
if (instance != nullptr) {
std::string instanceId = instance->mmapID();
Logger::log("RNMMKV", "Destroying MMKV instance \"%s\"...", instanceId.c_str());
instance->sync();
instance->clearMemoryCache();
}
instance = nullptr;
Expand Down

0 comments on commit 6eacc14

Please sign in to comment.