free return value of CDialogTemplate::Save() using delete[]
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4021 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5917388f61
commit
8bc1169798
2 changed files with 5 additions and 5 deletions
|
@ -476,12 +476,12 @@ int CEXEBuild::GenerateLangTables() {
|
|||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(id), NSIS_DEFAULT_LANG); \
|
||||
if (dlg) { \
|
||||
CDialogTemplate td(dlg); \
|
||||
free(dlg); \
|
||||
res_editor->FreeResource(dlg); \
|
||||
td.SetFont(build_font, build_font_size); \
|
||||
DWORD dwSize; \
|
||||
dlg = td.Save(dwSize); \
|
||||
res_editor->UpdateResource(RT_DIALOG, MAKEINTRESOURCE(id), NSIS_DEFAULT_LANG, dlg, dwSize); \
|
||||
res_editor->FreeResource(dlg); \
|
||||
delete [] dlg; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
@ -531,13 +531,13 @@ int CEXEBuild::GenerateLangTables() {
|
|||
BYTE* dlg = res_editor->GetResource(RT_DIALOG, MAKEINTRESOURCE(id), NSIS_DEFAULT_LANG); \
|
||||
if (dlg) { \
|
||||
CDialogTemplate td(dlg,lt[i].nlf.m_uCodePage); \
|
||||
free(dlg); \
|
||||
res_editor->FreeResource(dlg); \
|
||||
if (font) td.SetFont(font, lt[i].nlf.m_iFontSize); \
|
||||
if (lt[i].nlf.m_bRTL) td.ConvertToRTL(); \
|
||||
DWORD dwSize; \
|
||||
dlg = td.Save(dwSize); \
|
||||
res_editor->UpdateResource(RT_DIALOG, MAKEINTRESOURCE(id+cur_offset), NSIS_DEFAULT_LANG, dlg, dwSize); \
|
||||
res_editor->FreeResource(dlg); \
|
||||
delete [] dlg; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
|
@ -1950,7 +1950,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
DWORD dwSize;
|
||||
dlg = dt.Save(dwSize);
|
||||
res_editor->UpdateResource(RT_DIALOG, MAKEINTRESOURCE(IDD_INSTFILES), NSIS_DEFAULT_LANG, dlg, dwSize);
|
||||
res_editor->FreeResource(dlg);
|
||||
delete [] dlg;
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG("Error setting smooth progress bar: %s\n", err.what());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue