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:
+3
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user