mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +00:00
fixed resource leak (DestroyMenu before destroying main window)
fixed pointer cast warning -> UlongtoPtr (thx to Alex) svn path=/trunk/; revision=19238
This commit is contained in:
parent
fb818dc925
commit
1a42cad0e3
2 changed files with 3 additions and 3 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "framewnd.h"
|
#include "framewnd.h"
|
||||||
|
|
||||||
|
extern void ExitInstance();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Global Variables:
|
// Global Variables:
|
||||||
|
@ -228,6 +229,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
KillTimer(hWnd, 0);
|
KillTimer(hWnd, 0);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
|
ExitInstance();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -68,7 +68,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
|
|
||||||
hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_ZOOMIN_MENU));
|
hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_ZOOMIN_MENU));
|
||||||
|
|
||||||
hFrameWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle,
|
hFrameWnd = CreateWindowEx(0, (LPCTSTR)UlongToPtr(hFrameWndClass), szTitle,
|
||||||
WS_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE | WS_VSCROLL,
|
WS_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE | WS_VSCROLL,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, 250, 250,
|
CW_USEDEFAULT, CW_USEDEFAULT, 250, 250,
|
||||||
NULL, hMenuFrame, hInstance, NULL/*lpParam*/);
|
NULL, hMenuFrame, hInstance, NULL/*lpParam*/);
|
||||||
|
@ -90,7 +90,6 @@ void ExitInstance(void)
|
||||||
DestroyMenu(hMenuFrame);
|
DestroyMenu(hMenuFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||||
HINSTANCE hPrevInstance,
|
HINSTANCE hPrevInstance,
|
||||||
LPSTR lpCmdLine,
|
LPSTR lpCmdLine,
|
||||||
|
@ -116,6 +115,5 @@ int APIENTRY WinMain(HINSTANCE hInstance,
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ExitInstance();
|
|
||||||
return msg.wParam;
|
return msg.wParam;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue