Closed waitianlou closed 3 months ago
Never use MMKV before the main()
, period.
Never use MMKV before the
main()
, period.
Are there any known issues here, or has MMKV not been fully tested in this scenario?
You can't use MMKV before properly initializing it, and you can't properly initialize it before main()
.
Note:
An crash issue will be ignored & closed in a week without logs.
The language of MMKV
Objective-C
The version of MMKV
1.3.5
The platform of MMKV
iOS
The installation of MMKV
Cocoapods
What's the issue?
Using MMKV before the main, which means call initializeMMKV before main (such as in +load or other) will cause global class object MMKVPath_t to be overwritten as nil by __cxx_global_var_init after manual initialization.
What's the log of MMKV when that happened?
log:fail to open xxxxx (in MemoryFile.cpp) because g_rootDir is nil set by __cxx_global_var_init