From 7d1f94863150c165667f00ed7d79504a9ab691a7 Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 17 Apr 2007 20:41:17 +0000 Subject: [PATCH] - properly allocate size in AddScriptCmdArgs - do clean-up in WM_DESTROY, not only WM_CLOSE git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5098 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/makensisw.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Contrib/Makensisw/makensisw.cpp b/Contrib/Makensisw/makensisw.cpp index 99c9f589..66dd9998 100644 --- a/Contrib/Makensisw/makensisw.cpp +++ b/Contrib/Makensisw/makensisw.cpp @@ -101,7 +101,7 @@ void SetScript(const char *script, bool clearArgs /*= true*/) void AddScriptCmdArgs(const char *arg) { g_sdata.script_cmd_args = (char *) GlobalReAlloc(g_sdata.script_cmd_args, - GlobalSize(g_sdata.script_cmd_args) + 2 /* quotes */ + 1 /* space */, + GlobalSize(g_sdata.script_cmd_args) + lstrlen(arg) + 2 /* quotes */ + 1 /* space */, 0); lstrcat(g_sdata.script_cmd_args, " \""); @@ -217,23 +217,23 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { } case WM_DESTROY: { + DragAcceptFiles(g_sdata.hwnd,FALSE); SaveSymbols(); SaveCompressor(); SaveMRUList(); SaveWindowPos(g_sdata.hwnd); + ImageList_Destroy(g_toolbar.imagelist); + ImageList_Destroy(g_toolbar.imagelistd); + ImageList_Destroy(g_toolbar.imagelisth); DestroyTooltips(); + FreeLibrary(hRichEditDLL); PostQuitMessage(0); return TRUE; } case WM_CLOSE: { if (!g_sdata.thread) { - DragAcceptFiles(g_sdata.hwnd,FALSE); - ImageList_Destroy(g_toolbar.imagelist); - ImageList_Destroy(g_toolbar.imagelistd); - ImageList_Destroy(g_toolbar.imagelisth); DestroyWindow(hwndDlg); - FreeLibrary(hRichEditDLL); } return TRUE; }