Recompiling caussed memory leaks - fixed

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@950 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-09-06 22:18:47 +00:00
parent 18c5a5f1b8
commit 0818ec631c
2 changed files with 11 additions and 9 deletions

View file

@ -71,8 +71,6 @@ void ErrorMessage(HWND hwnd,const char *str) {
}
void DisableItems(HWND hwnd) {
g_output_exe[0]=0;
g_input_script[0]=0;
EnableWindow(GetDlgItem(hwnd,IDC_CLOSE),0);
EnableWindow(GetDlgItem(hwnd,IDC_TEST),0);
HMENU m = GetMenu(hwnd);
@ -90,8 +88,14 @@ void EnableItems(HWND hwnd) {
#define MSG1(a,b) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,b,0)
#define MSG2(a,b,c) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,b,c)
if (g_input_script) GlobalFree(g_input_script);
if (g_output_exe) GlobalFree(g_output_exe);
if (g_input_script) {
GlobalFree(g_input_script);
g_input_script = 0;
}
if (g_output_exe) {
GlobalFree(g_output_exe);
g_output_exe = 0;
}
TEXTRANGE tr;
FINDTEXT ft;
@ -124,7 +128,7 @@ void EnableItems(HWND hwnd) {
if (MSG2(EM_FINDTEXT, 0, (LPARAM)&ft) != -1) g_warnings++;
HMENU m = GetMenu(hwnd);
if (g_output_exe[0]) {
if (g_output_exe) {
EnableWindow(GetDlgItem(hwnd,IDC_TEST),1);
EnableMenuItem(m,IDM_TEST,MF_ENABLED);
}