fix MMKV instance lifecycle handling #1669

This commit is contained in:
guoling
2026-07-28 19:34:54 +08:00
parent e3060b1a34
commit f3b27766a2
23 changed files with 227 additions and 47 deletions
+4 -1
View File
@@ -397,7 +397,10 @@ PYBIND11_MODULE(mmkv, m) {
clsMMKV.def("isMultiProcess", &MMKV::isMultiProcess, "check multi-process mode");
clsMMKV.def("isReadOnly", &MMKV::isReadOnly, "check read-only mode");
clsMMKV.def("close", &MMKV::close, "close the instance");
clsMMKV.def("close", &MMKV::close,
"Permanently close the instance. This is terminal: all Python aliases "
"to the same native instance become invalid, and close must not race "
"with another operation.");
clsMMKV.def_static("rootDir", &MMKV::getRootDir, "get the root directory of MMKV");