Core: Use a shared_ptr for i18n categories.

This does not make them thread safe, but it reduces the chances of a crash
a bit (see #12594.)
This commit is contained in:
Unknown W. Brackets committed 2020-02-09 07:35:16 -08:00
1 parent a4ba5d4859
commit 5009698cc0
54 files changed
+244 -240

No files matched your search

+4 -4
View File
@@ -392,7 +392,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
if (!pspFileSystem.GetFileInfo(dirPath).exists) {
if (!pspFileSystem.MkDir(dirPath)) {
I18NCategory *err = GetI18NCategory("Error");
auto err = GetI18NCategory("Error");
host->NotifyUserMessage(err->T("Unable to write savedata, disk may be full"));
}
}
@@ -422,7 +422,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
}
if (EncryptData(decryptMode, cryptedData, &cryptedSize, &aligned_len, cryptedHash, (hasKey ? param->key : 0)) != 0) {
I18NCategory *err = GetI18NCategory("Error");
auto err = GetI18NCategory("Error");
host->NotifyUserMessage(err->T("Save encryption failed. This save won't work on real PSP"), 6.0f);
ERROR_LOG(SCEUTILITY,"Save encryption failed. This save won't work on real PSP");
delete[] cryptedData;
@@ -689,7 +689,7 @@ void SavedataParam::LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, co
// Don't notify the user if we're not going to upgrade the save.
if (!g_Config.bEncryptSave) {
I18NCategory *di = GetI18NCategory("Dialog");
auto di = GetI18NCategory("Dialog");
host->NotifyUserMessage(di->T("When you save, it will load on a PSP, but not an older PPSSPP"), 6.0f);
host->NotifyUserMessage(di->T("Old savedata detected"), 6.0f);
}
@@ -701,7 +701,7 @@ void SavedataParam::LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, co
}
if (g_Config.bSavedataUpgrade) {
decryptMode = prevCryptMode;
I18NCategory *di = GetI18NCategory("Dialog");
auto di = GetI18NCategory("Dialog");
host->NotifyUserMessage(di->T("When you save, it will not work on outdated PSP Firmware anymore"), 6.0f);
host->NotifyUserMessage(di->T("Old savedata detected"), 6.0f);
}