Windows: free more allocated memory before exit

This gets rid of the final leak complaint on Windows as of Nov 13, 2024
This commit is contained in:
nhmall
2024-11-13 13:48:50 -05:00
parent c85b5d3e56
commit fa9210aa65
11 changed files with 57 additions and 15 deletions
+3 -1
View File
@@ -208,9 +208,11 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
data = (PNHMainWindow) malloc(sizeof(NHMainWindow));
if (!data)
panic("out of memory");
ZeroMemory(data, sizeof(NHMainWindow));
data->mapAcsiiModeSave = MAP_MODE_ASCII12x16;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) data);
windowdata[NHW_MAIN].address = (genericptr_t) data;
/* update menu items */
CheckMenuItem(
@@ -509,7 +511,7 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
/* clean up */
free((PNHMainWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA));
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) 0);
windowdata[NHW_MAIN].address = 0;
// PostQuitMessage(0);
exit(1);
break;