summaryrefslogtreecommitdiffstats
path: root/src/extras/frontendoption.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-09-26 11:30:14 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-09-26 11:30:14 +0200
commit375c7df00f4b95ca52906cf337fad0eefd18d0da (patch)
tree817249f1c2a2d1b0fe17c5e63cd9ef2aa9d0e483 /src/extras/frontendoption.cpp
parentupdate lib (diff)
parentFixes from miami (diff)
downloadre3-375c7df00f4b95ca52906cf337fad0eefd18d0da.tar
re3-375c7df00f4b95ca52906cf337fad0eefd18d0da.tar.gz
re3-375c7df00f4b95ca52906cf337fad0eefd18d0da.tar.bz2
re3-375c7df00f4b95ca52906cf337fad0eefd18d0da.tar.lz
re3-375c7df00f4b95ca52906cf337fad0eefd18d0da.tar.xz
re3-375c7df00f4b95ca52906cf337fad0eefd18d0da.tar.zst
re3-375c7df00f4b95ca52906cf337fad0eefd18d0da.zip
Diffstat (limited to 'src/extras/frontendoption.cpp')
-rw-r--r--src/extras/frontendoption.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/extras/frontendoption.cpp b/src/extras/frontendoption.cpp
index 3214bbfd..f8d9f81e 100644
--- a/src/extras/frontendoption.cpp
+++ b/src/extras/frontendoption.cpp
@@ -76,6 +76,10 @@ RemoveCustomFrontendOptions()
for (int j = 0; j < NUM_MENUROWS; j++) {
if (aScreens[i].m_aEntries[j].m_SaveSlot == SAVESLOT_CFO) {
int ogOptionId = customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].ogOptionId;
+
+ if (customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].type == FEOPTION_SELECT)
+ free(customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].rightTexts);
+
if (ogOptionId == -1) {
int k;
for (k = j; k < NUM_MENUROWS - 1; k++) {
@@ -219,7 +223,8 @@ void FrontendOptionAddSelect(const wchar* leftText, const wchar** rightTexts, in
FrontendOption& option = customFrontendOptions[numCustomFrontendOptions - 1];
option.type = FEOPTION_SELECT;
TextCopy(option.leftText, leftText);
- option.rightTexts = rightTexts;
+ option.rightTexts = (wchar**)malloc(numRightTexts * sizeof(wchar*));
+ memcpy(option.rightTexts, rightTexts, numRightTexts * sizeof(wchar*));
option.numRightTexts = numRightTexts;
option.value = var;
option.displayedValue = *var;